Compare commits

..

1 Commits

Author SHA1 Message Date
DESKTOP-QHP1O2H\MIKE d6eadbb46b Changed position of the login error message 2023-01-25 07:02:33 -05:00
+9 -9
View File
@@ -10,7 +10,7 @@ export default function Login() {
const [checked, setValue] = useState(false); const [checked, setValue] = useState(false);
const [loginLoading, setLoginLoading] = useState(false); const [loginLoading, setLoginLoading] = useState(false);
//logIn error state //login error state
const [loginError, setLoginError] = useState(false); const [loginError, setLoginError] = useState(false);
const rememberMe = () => { const rememberMe = () => {
@@ -22,13 +22,11 @@ export default function Login() {
const handleEmail = (e) => { const handleEmail = (e) => {
setMail(e.target.value); setMail(e.target.value);
}; };
// password // password
const [password, setPassword] = useState("123456"); const [password, setPassword] = useState("123456");
const handlePassword = (e) => { const handlePassword = (e) => {
setPassword(e.target.value); setPassword(e.target.value);
}; };
const navigate = useNavigate(); const navigate = useNavigate();
const doLogin = () => { const doLogin = () => {
if (email !== "" && password !== "") { if (email !== "" && password !== "") {
@@ -41,6 +39,7 @@ export default function Login() {
setLoginLoading(false); setLoginLoading(false);
}, 2000); }, 2000);
} else { } else {
// toast.error("Invalid Credential");
setLoginError(true) setLoginError(true)
} }
} }
@@ -108,7 +107,7 @@ export default function Login() {
</button> </button>
<span <span
onClick={rememberMe} onClick={rememberMe}
className="text-base text-dark-gray dark:text-white" className="text-base text-dark-gray dark:text-white"
> >
Remember Me Remember Me
</span> </span>
@@ -122,8 +121,9 @@ export default function Login() {
<button <button
onClick={doLogin} onClick={doLogin}
type="button" 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 ? ( {loginLoading ? (
<div className="signup btn-loader"></div> <div className="signup btn-loader"></div>
@@ -132,7 +132,7 @@ export default function Login() {
)} )}
</button> </button>
</div> </div>
{loginError && <p className="text-center text-red-700 pb-4">Invalid Credential</p>} {loginError && <p class="text-center text-red-600 pb-4">Invalid Credential</p>}
<a <a
href="#" 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" className="w-full border border-light-purple dark:border-[#5356fb29] rounded-[50px] h-[58px] flex justify-center bg-[#FAFAFA] dark:bg-[#11131F] items-center"
@@ -145,7 +145,7 @@ export default function Login() {
</div> </div>
<div className="signup-area flex justify-center"> <div className="signup-area flex justify-center">
<p className="sm:text-lg text-sm text-thin-light-gray font-normal"> <p className="sm:text-lg text-sm text-thin-light-gray font-normal">
Dont have an account ? Dontt have an aceount ?
<a href="/signup" className="ml-2 text-dark-gray dark:text-white"> <a href="/signup" className="ml-2 text-dark-gray dark:text-white">
Sign up free Sign up free
</a> </a>
@@ -157,4 +157,4 @@ export default function Login() {
</AuthLayout> </AuthLayout>
</> </>
); );
} }