Added back to log in button function
This commit is contained in:
1 parent
fb3b54fef9
commit
61ab413f58
1 file changed
+11
-1
@@ -6,10 +6,20 @@ import Button from "../../Components/Button";
|
|||||||
import { Stack, Typography } from "@mui/material";
|
import { Stack, Typography } from "@mui/material";
|
||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import { useNavigate } from "react-router";
|
import { useNavigate } from "react-router";
|
||||||
|
import { useDispatch } from "react-redux";
|
||||||
|
import { clearAuthState } from "../../Features/Auth/authSlice";
|
||||||
|
import { clearMonitorState } from "../../Features/Monitors/monitorsSlice";
|
||||||
|
|
||||||
const NewPasswordConfirmed = () => {
|
const NewPasswordConfirmed = () => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
|
||||||
|
const handleNavigate = () => {
|
||||||
|
dispatch(clearAuthState());
|
||||||
|
dispatch(clearMonitorState());
|
||||||
|
navigate("/login");
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="password-confirmed-page">
|
<div className="password-confirmed-page">
|
||||||
@@ -32,7 +42,7 @@ const NewPasswordConfirmed = () => {
|
|||||||
label="Back to log in"
|
label="Back to log in"
|
||||||
img={<ArrowBackRoundedIcon />}
|
img={<ArrowBackRoundedIcon />}
|
||||||
sx={{ alignSelf: "center", width: "fit-content" }}
|
sx={{ alignSelf: "center", width: "fit-content" }}
|
||||||
onClick={() => navigate("/login")}
|
onClick={handleNavigate}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
Reference in new issue
Block a user