Skip to content

Commit

Permalink
Modified Login Page
Browse files Browse the repository at this point in the history
  • Loading branch information
sourav215 committed Jan 6, 2023
1 parent d989557 commit 25b17e7
Showing 1 changed file with 63 additions and 2 deletions.
65 changes: 63 additions & 2 deletions policybazaar/src/Components/Login/Login.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,68 @@
import { useState, useEffect } from "react";
import { useDispatch, useSelector } from "react-redux";
import { Navigate } from "react-router-dom";

import lgnstl from "./Login.module.css";
import { CgCloseO } from "react-icons/cg";

import LoginForm from "./LoginForm";
import SignupForm from "./SignupForm";
function Login() {
const [page, setPage] = useState(true);
const [navigateToHome, setNavigateToHome] = useState(false);
const { isAuth } = useSelector((store) => store);
const goBackToHome = () => {
setNavigateToHome(true);
};
if (isAuth || navigateToHome) {
return <Navigate to={"/"} />;
}

return (
<div>
<h1>Login Page</h1>
<div className={lgnstl.login_main}>
<div className={lgnstl.login_container}>
<div className={lgnstl.icon_div}>
<CgCloseO
onClick={() => {
goBackToHome();
}}
/>
</div>
<div className={lgnstl.logo_div}>
<img
src="https://static.pbcdn.in/cdn/images/new-home/logopb.svg?v=2"
alt="logo"
/>
</div>
<div className={lgnstl.title_div}>
<div>
<img
src="https://static.pbcdn.in/myaccount-cdn/images/login-illusion.png"
alt=""
/>
</div>
<div>
<h3>
To {page ? "sign in" : "sign up"}, please enter your mobile number
</h3>
</div>
</div>

{page ? (
<LoginForm />
) : (
<SignupForm gotoPrevious={() => setPage(true)} />
)}

<div className={lgnstl.changepage}>
<p>
{page ? "First time user? " : "Already Signed up? "}
<span className={lgnstl.spn} onClick={() => setPage(!page)}>
{page ? "Sign up" : "Sign in"}
</span>
</p>
</div>
</div>
</div>
);
}
Expand Down

0 comments on commit 25b17e7

Please sign in to comment.