Skip to content

Commit

Permalink
V 1.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Majesty-12 committed Jun 30, 2021
1 parent 1e1d71c commit f1ea419
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 15 deletions.
16 changes: 10 additions & 6 deletions components/AddTask.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,14 @@ export default function AddTask(props) {
// specifying the backend
const API_BASE_URL = "https://todo-app-csoc.herokuapp.com/";
const [value, setValue] = useState("");
// here initialising the empty string to state 'value'


const addTask = () => {
const todoText = value.trim();
// for trimming the text

if (!todoText) {
if (!todoText) { // when the todo text is empty
// izitoast for the better userinterface
iziToast.destroy();
iziToast.error({
Expand Down Expand Up @@ -57,17 +61,17 @@ export default function AddTask(props) {
props.addNewTask(newTask);
iziToast.destroy();
iziToast.success({
title: "Todo",
message: "😀Successfully added new Todo"
title: "😀",
message: "Successfully added new Todo"
});
});
})
// promises part
.catch(function (err) {
iziToast.destroy();
iziToast.error({
title: "Error",
message: "😫Error Occured"
title: "😫",
message: "Error Occured"
});
});
};
Expand All @@ -94,7 +98,7 @@ export default function AddTask(props) {
{/* adding the button to add the task to your Todo list */}
<button
type="button"
className="todo-add-task bg-transparent hover:bg-green-500 text-green-700 text-sm hover:text-white px-3 py-2 border border-green-500 hover:border-transparent rounded"
className="todo-add-task bg-green hover:bg-white-500 text-white-700 text-sm hover:text-green px-3 py-2 border border-green-500 hover:border-green rounded"
onClick={addTask}>
Add Task
</button>
Expand Down
7 changes: 6 additions & 1 deletion components/LoginForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React, { useState } from "react";
import axios from "axios";
import { useRouter } from "next/router";
import { useAppContext } from "../context/AppContext";

import Link from 'next/link'



Expand Down Expand Up @@ -110,14 +110,19 @@ export default function LoginForm() {
onClick={login}>
Click Here to Login
</button>


<button className='w-full text-center py-3 rounded bg-transparent text-yellow-500 hover:text-white hover:bg-yellow-500 border border-yellow-500 hover:border-transparent focus:outline-none my-1'><u><Link href='/register' >New? Sign Up First</Link></u></button>


{/* forgot username and password button */}
<a href= 'https://naveen-kumar-portfolio.herokuapp.com' ><button
type="submit"
className="w-full text-center py-3 rounded bg-transparent text-blue-500 hover:text-white hover:bg-blue-500 border border-blue-500 hover:border-transparent focus:outline-none my-1"
>
Forgot Something Contact Us !
</button></a>

</div>
</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion components/RegisterForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export default function RegisterForm() {
if (registerFieldsAreValid(firstName, lastName, email, username, password)) {
iziToast.destroy();
iziToast.info({
title: "Info",
title: "Wait",
message: "Processing..."
});

Expand Down Expand Up @@ -118,6 +118,7 @@ export default function RegisterForm() {


{/* input field start here */}
{/* the inputs are set with the useState in React */}
<input
type="text"
className="block border border-grey-light w-full p-3 rounded mb-4"
Expand Down
11 changes: 6 additions & 5 deletions components/TodoListItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ export default function TodoListItem(props) {
props.deleteTask(id);
iziToast.destroy();
iziToast.info({
title: "Todo",
title: "💀",
message: "Todo Deleted Successfully"
});
})
.catch(function (error) {
iziToast.destroy();
iziToast.error({
title: "Error",
title: "😥",
message: "Something went Wrong !"
});
});
Expand All @@ -68,7 +68,7 @@ export default function TodoListItem(props) {
if (!todoText) {
iziToast.destroy();
iziToast.error({
title: "Error",
title: "😥",
message: "Start adding !"
});
return;
Expand All @@ -95,14 +95,14 @@ export default function TodoListItem(props) {
setEditMode(false);
iziToast.destroy();
iziToast.info({
title: "Todo",
title: "",
message: "Todo Updated Successfully !"
});
})
.catch(function (err) {
iziToast.destroy();
iziToast.error({
title: "Error",
title: "😥",
message: "Something went Wrong !"
});
});
Expand Down Expand Up @@ -161,6 +161,7 @@ export default function TodoListItem(props) {



{/* for deleting the Todo by passing the Id as reference to know to delete the particular Todo having the same Id as passed */}
<button
type="button"
className="bg-transparent hover:bg-red-500 hover:text-white border border-red-500 hover:border-transparent rounded px-2 pt-1"
Expand Down
2 changes: 1 addition & 1 deletion public/sw.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ body{
height: 100vh;
font-family: sans-serif;
/* color: #fff; */
background: linear-gradient(-55deg, #059669,#99f2c8, #059669);
background: linear-gradient(-55deg, #059669,#c8ecdb, #059669);
background-size: 400% 400%;
-webkit-animation: gradientBackground 10s ease infinite;
animation: gradientBackground 10s ease infinite;
Expand Down Expand Up @@ -80,4 +80,10 @@ body{
100% {
background-position: 0% 50%;
}
}

.register{
display: flex;
align-items: center;
justify-content: center;
}

0 comments on commit f1ea419

Please sign in to comment.