import React, { useState } from "react"; import { useNavigate } from "react-router-dom"; import { toast } from "react-toastify"; import googleLogo from "../../../assets/images/google-logo.svg"; // import titleShape from "../../../assets/images/shape/title-shape.svg"; import titleShape from "../../../assets/images/shape/login_straight_underline.svg"; import InputCom from "../../Helpers/Inputs/InputCom"; 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); }; // email const [email, setMail] = useState("support@chiefsoft.com"); 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 !== "") { if (email === "support@chiefsoft.com") { localStorage.setItem("email", `${email}`); setLoginLoading(true); setTimeout(() => { toast.success("Login Successfully"); navigate("/", { replace: true }); setLoginLoading(false); }, 2000); } else { // toast.error("Invalid Credential"); setLoginError(true) } } }; return ( <>

Log In

shape
Remember Me
Forgot Password
{loginError &&

Invalid username or password

} google logo Sign In with Google

Don't have an account ? Sign up free

); }