Added back to log in button function

This commit is contained in:
Daniel Cojocea committed 2024-07-16 17:41:26 -04:00
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>