diff --git a/src/components/AuthPages/Login/index.jsx b/src/components/AuthPages/Login/index.jsx index 0a9c50c..2f09fa6 100644 --- a/src/components/AuthPages/Login/index.jsx +++ b/src/components/AuthPages/Login/index.jsx @@ -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() { + {loginError &&

Invalid Credential

}

- Dont’t have an aceount ? + Don’t have an account ? Sign up free