From 9ef1c3572efa1c7a0fa13cf1424ce69cdaf54072 Mon Sep 17 00:00:00 2001 From: Peter Carl Pardo Date: Fri, 20 Dec 2024 23:37:58 +0800 Subject: [PATCH] feat: created ForgotPasswordLabel.jsx component --- .../Login/Components/ForgotPasswordLabel.jsx | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 Client/src/Pages/Auth/Login/Components/ForgotPasswordLabel.jsx diff --git a/Client/src/Pages/Auth/Login/Components/ForgotPasswordLabel.jsx b/Client/src/Pages/Auth/Login/Components/ForgotPasswordLabel.jsx new file mode 100644 index 000000000..0a5fa8153 --- /dev/null +++ b/Client/src/Pages/Auth/Login/Components/ForgotPasswordLabel.jsx @@ -0,0 +1,43 @@ +import { Box, Typography, useTheme } from "@mui/material"; +import PropTypes from "prop-types"; +import { useNavigate } from "react-router"; + +const ForgotPasswordLabel = ({ email, errorEmail }) => { + const theme = useTheme(); + const navigate = useNavigate(); + + const handleNavigate = () => { + if (email !== "" && !errorEmail) { + sessionStorage.setItem("email", email); + } + navigate("/forgot-password"); + }; + + return ( + + + Forgot password? + + + Reset password + + + ); +}; + +ForgotPasswordLabel.proptype = { + email: PropTypes.string.isRequired, + emailError: PropTypes.string.isRequired, +}; + +export default ForgotPasswordLabel;