From fdbab559c8be982c9c9aa97a9b501d94925c5c3b Mon Sep 17 00:00:00 2001 From: siddheshmorewdi Date: Mon, 10 Jun 2024 17:28:43 +0530 Subject: [PATCH] login update --- .env | 2 +- src/Pages/Login.jsx | 54 +++++++++++++++++++++++++++------------------ 2 files changed, 34 insertions(+), 22 deletions(-) diff --git a/.env b/.env index 9b5f3f2..63810f5 100644 --- a/.env +++ b/.env @@ -1,3 +1,3 @@ -VITE_API_BASE_URL="https://rubix.betadelivery.com/api" +VITE_API_BASE_URL="https://rubix.betadelivery.com" VITE_API_IMAGE_URL="https://rubix.betadelivery.com" VITE_API_ENVIRONMENT="development" \ No newline at end of file diff --git a/src/Pages/Login.jsx b/src/Pages/Login.jsx index dbf16a6..c574b9b 100644 --- a/src/Pages/Login.jsx +++ b/src/Pages/Login.jsx @@ -18,14 +18,18 @@ import { FormControl, FormLabel, Input, + InputGroup, + InputRightElement, useToast, } from "@chakra-ui/react"; import GlobalStateContext from "../Contexts/GlobalStateContext"; -import Cookies from 'js-cookie'; +import Cookies from "js-cookie"; import { validationSchema } from "../Validations/Validations"; import ToastBox from "../Components/ToastBox"; const Login = () => { + const [show, setShow] = useState(false); + const handleClick = () => setShow(!show); const { isAuthenticate, setIsAuthenticate } = useContext(GlobalStateContext); const toast = useToast(); // const { isAuthenticate } = useSelector((state) => state?.auth); @@ -45,7 +49,7 @@ const Login = () => { if (value.name === "Admin" && value.password === "Admin") { return setTimeout(() => { // dispatch(loginUser(true)); - setIsAuthenticate(true) + setIsAuthenticate(true); setIsLoading(false); toast({ render: () => ( @@ -53,16 +57,15 @@ const Login = () => { ), }); - Cookies.set('isAuthenticated', true, { expires: 7 }); + Cookies.set("isAuthenticated", true, { expires: 7 }); navigate("/"); }, 2000); // 3-second delay } else { - return setTimeout(() => { // dispatch(loginUser(true)); - setIsAuthenticate(false) + setIsAuthenticate(false); setIsLoading(false); - + toast({ render: () => ( @@ -157,17 +160,28 @@ const Login = () => { Password * - - + + + + + + {errors.password && ( {errors.password.message} @@ -229,15 +243,13 @@ const Login = () => { position: "absolute", top: 0, left: 0, - width:300 + width: 300, }} - src={Ellipse4} alt="bg-img" /> - -