Files
Checkmate/Client/src/Pages/Auth/NewPasswordConfirmed.jsx
T

61 lines
2.1 KiB
React
Raw Normal View History

import "./index.css";
2024-07-17 17:44:29 -04:00
import background from "../../assets/Images/background_pattern_decorative.png";
2024-07-16 16:57:42 -04:00
import ArrowBackRoundedIcon from "@mui/icons-material/ArrowBackRounded";
import ConfirmIcon from "../../assets/icons/confirm-icon.svg?react";
import Button from "../../Components/Button";
2024-07-16 16:57:42 -04:00
import { Stack, Typography } from "@mui/material";
import { useTheme } from "@emotion/react";
import { useNavigate } from "react-router";
2024-07-16 17:41:26 -04:00
import { useDispatch } from "react-redux";
import { clearAuthState } from "../../Features/Auth/authSlice";
2024-07-30 11:25:14 -07:00
import { clearUptimeMonitorState } from "../../Features/UptimeMonitors/uptimeMonitorsSlice";
const NewPasswordConfirmed = () => {
2024-07-16 16:57:42 -04:00
const theme = useTheme();
const navigate = useNavigate();
2024-07-16 17:41:26 -04:00
const dispatch = useDispatch();
const handleNavigate = () => {
dispatch(clearAuthState());
2024-07-30 11:25:14 -07:00
dispatch(clearUptimeMonitorState());
2024-07-16 17:41:26 -04:00
navigate("/login");
2024-07-16 18:37:29 -04:00
};
2024-07-16 16:57:42 -04:00
return (
<div className="password-confirmed-page">
2024-07-17 17:44:29 -04:00
<img
className="background-pattern-svg"
src={background}
alt="background pattern"
/>
2024-07-16 16:57:42 -04:00
<form className="password-confirmed-form">
<Stack direction="column" alignItems="center" gap={theme.gap.small}>
<ConfirmIcon alt="confirm icon" style={{ fill: "white" }} />
<Typography component="h1" sx={{ mt: theme.gap.ml }}>
Password reset
</Typography>
<Typography sx={{ textAlign: "center" }}>
Your password has been successfully reset. Click below to log in
magically.
2024-07-16 16:57:42 -04:00
</Typography>
</Stack>
<Stack gap={theme.gap.large} sx={{ mt: `calc(${theme.gap.ml}*2)` }}>
2024-07-16 18:37:29 -04:00
<Button
level="primary"
label="Continue"
onClick={() => navigate("/monitors")}
/>
<Button
2024-07-16 16:57:42 -04:00
level="tertiary"
label="Back to log in"
img={<ArrowBackRoundedIcon />}
sx={{ alignSelf: "center", width: "fit-content" }}
2024-07-16 17:41:26 -04:00
onClick={handleNavigate}
/>
2024-07-16 16:57:42 -04:00
</Stack>
</form>
</div>
);
};
export default NewPasswordConfirmed;