Commit 6b6959bb authored by Aman Kumar's avatar Aman Kumar
Browse files

Logout functionality add commit

parent 5d15f704
......@@ -9,4 +9,8 @@
/* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
background: linear-gradient(to right, rgba(106, 17, 203, 1), rgba(37, 117, 252, 1))
}
.form-input{
color:#fff !important
}
\ No newline at end of file
......@@ -76,6 +76,7 @@ function Login() {
name="email"
onChange={(e) => handleInputUpdate(e)}
id="formControlLg"
className="form-input"
type="email"
size="lg"
/>
......@@ -85,6 +86,7 @@ function Login() {
label="Password"
name="password"
id="formControlLg"
className="form-input"
type="password"
onChange={(e) => handleInputUpdate(e)}
size="lg"
......
......@@ -10,3 +10,8 @@
/* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
background: linear-gradient(to right, rgba(106, 17, 203, 1), rgba(37, 117, 252, 1))
}
.form-input{
color:#fff !important
}
......@@ -83,6 +83,7 @@ function Register() {
wrapperClass="mb-4 mx-5 w-100"
color="white"
labelClass="text-white"
className="form-input"
onChange={(e) => handleInputUpdate(e)}
name="username"
label="User name"
......@@ -93,6 +94,7 @@ function Register() {
<MDBInput
wrapperClass="mb-4 mx-5 w-100"
labelClass="text-white"
className="form-input"
onChange={(e) => handleInputUpdate(e)}
name="email"
label="Email address"
......@@ -103,6 +105,7 @@ function Register() {
<MDBInput
wrapperClass="mb-4 mx-5 w-100"
labelClass="text-white"
className="form-input"
onChange={(e) => handleInputUpdate(e)}
name="password"
label="Password"
......@@ -113,6 +116,7 @@ function Register() {
<MDBInput
wrapperClass="mb-4 mx-5 w-100"
labelClass="text-white"
className="form-input"
onChange={(e) => handleInputUpdate(e)}
name="confirmPassword"
label="Confirm Password"
......
......@@ -158,16 +158,18 @@ export default function Register() {
</h6>
</td>
<td className="align-middle">
<MDBTooltip tag="a" wrapperProps={{ href: "#!" }} title="Done">
<MDBIcon
fas
icon="check"
color="success"
size="lg"
className="me-3"
onClick={() => updateTaskStatus(task._id)}
/>
</MDBTooltip>
{!task.isCompletedTask && (
<MDBTooltip tag="a" wrapperProps={{ href: "#!" }} title="Done">
<MDBIcon
fas
icon="check"
color="success"
size="lg"
className="me-3"
onClick={() => updateTaskStatus(task._id)}
/>
</MDBTooltip>
)}
<MDBTooltip tag="a" wrapperProps={{ href: "#!" }} title="Remove">
<MDBIcon
fas
......@@ -191,6 +193,18 @@ export default function Register() {
<MDBRow className="d-flex justify-content-center align-items-center">
<MDBCol md="12" xl="10">
<MDBCard>
{isLoggedIn && (
<MDBBtn
style={{ position: "absolute", right: "10px", top: "10px" }}
color="danger"
onClick={() => {
localStorage.removeItem("token"); // Clear token from localStorage
window.location.reload(); // Reload the page
}}
>
Logout
</MDBBtn>
)}
<MDBCardBody className="p-4 text-black">
<div className="text-center pt-3 pb-2">
<img
......@@ -199,6 +213,7 @@ export default function Register() {
width="60"
/>
<h2 className="my-4">Task List</h2>
{isLoggedIn && (
<MDBBtn onClick={() => setShowForm(!showForm)}>
Create Task
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment