Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 268e06c9a7 |
@@ -9,6 +9,10 @@ import AuthLayout from "../AuthLayout";
|
||||
export default function Login() {
|
||||
const [checked, setValue] = useState(false);
|
||||
const [loginLoading, setLoginLoading] = useState(false);
|
||||
|
||||
//logIn error state
|
||||
const [loginError, setLoginError] = useState(false);
|
||||
|
||||
const rememberMe = () => {
|
||||
setValue(!checked);
|
||||
};
|
||||
@@ -18,11 +22,13 @@ export default function Login() {
|
||||
const handleEmail = (e) => {
|
||||
setMail(e.target.value);
|
||||
};
|
||||
|
||||
// password
|
||||
const [password, setPassword] = useState("123456");
|
||||
const handlePassword = (e) => {
|
||||
setPassword(e.target.value);
|
||||
};
|
||||
|
||||
const navigate = useNavigate();
|
||||
const doLogin = () => {
|
||||
if (email !== "" && password !== "") {
|
||||
@@ -35,7 +41,7 @@ export default function Login() {
|
||||
setLoginLoading(false);
|
||||
}, 2000);
|
||||
} else {
|
||||
toast.error("Invalid Credential");
|
||||
setLoginError(true)
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -116,9 +122,8 @@ export default function Login() {
|
||||
<button
|
||||
onClick={doLogin}
|
||||
type="button"
|
||||
className={`btn-login rounded-[50px] mb-6 text-xl text-white font-bold flex justify-center bg-purple items-center ${
|
||||
loginLoading ? "active" : ""
|
||||
}`}
|
||||
className={`btn-login rounded-[50px] mb-6 text-xl text-white font-bold flex justify-center bg-purple items-center ${loginLoading ? "active" : ""
|
||||
}`}
|
||||
>
|
||||
{loginLoading ? (
|
||||
<div className="signup btn-loader"></div>
|
||||
@@ -127,6 +132,7 @@ export default function Login() {
|
||||
)}
|
||||
</button>
|
||||
</div>
|
||||
{loginError && <p className="text-center text-red-700 pb-4">Invalid Credential</p>}
|
||||
<a
|
||||
href="#"
|
||||
className="w-full border border-light-purple dark:border-[#5356fb29] rounded-[50px] h-[58px] flex justify-center bg-[#FAFAFA] dark:bg-[#11131F] items-center"
|
||||
@@ -139,7 +145,7 @@ export default function Login() {
|
||||
</div>
|
||||
<div className="signup-area flex justify-center">
|
||||
<p className="sm:text-lg text-sm text-thin-light-gray font-normal">
|
||||
Dont’t have an aceount ?
|
||||
Don’t have an account ?
|
||||
<a href="/signup" className="ml-2 text-dark-gray dark:text-white">
|
||||
Sign up free
|
||||
</a>
|
||||
|
||||
Reference in New Issue
Block a user