reset password link added
This commit is contained in:
1 parent
ff6c890eb0
commit
7f7423aed8
1 file changed
+38
-2
@@ -1,8 +1,9 @@
|
|||||||
import { useRef, useEffect } from "react";
|
import { useRef, useEffect } from "react";
|
||||||
import { Box, Button, Stack, Typography } from "@mui/material";
|
import { Box, Button, Stack, Typography } from "@mui/material";
|
||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import TextInput from "../../../../Components/Inputs/TextInput";
|
import TextInput from "../../../../Components/Inputs/TextInput";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
|
import { useNavigate } from "react-router";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Renders the email step of the login process which includes an email field.
|
* Renders the email step of the login process which includes an email field.
|
||||||
@@ -18,6 +19,7 @@ import PropTypes from "prop-types";
|
|||||||
const EmailStep = ({ form, errors, onSubmit, onChange }) => {
|
const EmailStep = ({ form, errors, onSubmit, onChange }) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const inputRef = useRef(null);
|
const inputRef = useRef(null);
|
||||||
|
const navigate = useNavigate();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (inputRef.current) {
|
if (inputRef.current) {
|
||||||
@@ -25,11 +27,19 @@ const EmailStep = ({ form, errors, onSubmit, onChange }) => {
|
|||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
const handleNavigate = () => {
|
||||||
|
if (form.email !== "" && !errors.email) {
|
||||||
|
sessionStorage.setItem("email", form.email);
|
||||||
|
}
|
||||||
|
navigate("/forgot-password");
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack
|
<Stack
|
||||||
gap={{ xs: theme.spacing(12), sm: theme.spacing(16) }}
|
gap={{ xs: theme.spacing(12), sm: theme.spacing(16) }}
|
||||||
textAlign="center"
|
textAlign="center"
|
||||||
|
position="relative"
|
||||||
>
|
>
|
||||||
<Box>
|
<Box>
|
||||||
<Typography component="h1">Log In</Typography>
|
<Typography component="h1">Log In</Typography>
|
||||||
@@ -80,6 +90,32 @@ const EmailStep = ({ form, errors, onSubmit, onChange }) => {
|
|||||||
</Button>
|
</Button>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Box>
|
</Box>
|
||||||
|
<Box
|
||||||
|
textAlign="center"
|
||||||
|
sx={{
|
||||||
|
position: "absolute",
|
||||||
|
bottom: 0,
|
||||||
|
left: "50%",
|
||||||
|
transform: `translate(-50%, 150%)`,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Typography
|
||||||
|
className="forgot-p"
|
||||||
|
display="inline-block"
|
||||||
|
color={theme.palette.primary.main}
|
||||||
|
>
|
||||||
|
Forgot password?
|
||||||
|
</Typography>
|
||||||
|
<Typography
|
||||||
|
component="span"
|
||||||
|
color={theme.palette.primary.main}
|
||||||
|
ml={theme.spacing(2)}
|
||||||
|
sx={{ userSelect: "none" }}
|
||||||
|
onClick={handleNavigate}
|
||||||
|
>
|
||||||
|
Reset password
|
||||||
|
</Typography>
|
||||||
|
</Box>
|
||||||
</Stack>
|
</Stack>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
@@ -92,4 +128,4 @@ EmailStep.propTypes = {
|
|||||||
onChange: PropTypes.func.isRequired,
|
onChange: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default EmailStep;
|
export default EmailStep;
|
||||||
Reference in new issue
Block a user