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

114 lines
3.3 KiB
React
Raw Normal View History

2024-08-12 15:35:36 -04:00
import { Box, Stack, Typography } from "@mui/material";
2024-07-16 16:57:42 -04:00
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";
2024-08-12 15:35:36 -04:00
import Button from "../../Components/Button";
import background from "../../assets/Images/background_pattern_decorative.png";
import ConfirmIcon from "../../assets/icons/confirm-icon.svg?react";
import Logo from "../../assets/icons/bwu-icon.svg?react";
import "./index.css";
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 (
2024-08-27 20:11:59 -04:00
<Stack
className="password-confirmed-page auth"
overflow="hidden"
sx={{
"& h1": {
color: theme.palette.common.main,
fontWeight: 600,
fontSize: 22,
},
"& p": {
fontSize: 14,
color: theme.palette.text.accent,
},
}}
>
<Box
2024-07-17 17:44:29 -04:00
className="background-pattern-svg"
sx={{ backgroundImage: `url(${background})` }}
2024-07-17 17:44:29 -04:00
/>
2024-08-12 15:35:36 -04:00
<Stack
direction="row"
alignItems="center"
2024-08-27 20:11:59 -04:00
px={theme.spacing(12)}
gap={theme.spacing(4)}
2024-08-12 15:35:36 -04:00
>
<Logo style={{ borderRadius: theme.shape.borderRadius }} />
<Typography sx={{ userSelect: "none" }}>BlueWave Uptime</Typography>
</Stack>
<Stack
width="100%"
maxWidth={600}
flex={1}
justifyContent="center"
2024-08-27 20:11:59 -04:00
px={{ xs: theme.spacing(12), lg: theme.spacing(20) }}
pb={theme.spacing(20)}
2024-08-12 15:35:36 -04:00
mx="auto"
sx={{
"& > .MuiStack-root": {
border: 1,
2024-08-27 20:11:59 -04:00
borderRadius: theme.spacing(5),
borderColor: theme.palette.border.light,
backgroundColor: theme.palette.background.main,
2024-08-12 15:35:36 -04:00
padding: {
2024-08-27 20:11:59 -04:00
xs: theme.spacing(12),
sm: theme.spacing(20),
2024-08-12 15:35:36 -04:00
},
},
}}
>
<Stack
2024-08-27 20:11:59 -04:00
gap={{ xs: theme.spacing(8), sm: theme.spacing(12) }}
alignItems="center"
textAlign="center"
>
<Box>
<ConfirmIcon alt="password confirm icon" />
<Typography component="h1">Password reset</Typography>
2024-08-27 20:11:59 -04:00
<Typography mt={theme.spacing(2)}>
Your password has been successfully reset. Click below to log in
magically.
</Typography>
</Box>
<Button
level="primary"
label="Continue"
onClick={() => navigate("/monitors")}
sx={{
width: "100%",
maxWidth: 400,
}}
/>
</Stack>
</Stack>
2024-08-27 20:11:59 -04:00
<Box textAlign="center" p={theme.spacing(12)}>
2024-08-12 15:35:36 -04:00
<Typography display="inline-block">Go back to —</Typography>
<Typography
component="span"
2024-08-27 20:11:59 -04:00
color={theme.palette.common.main}
ml={theme.spacing(2)}
onClick={handleNavigate}
2024-08-12 15:35:36 -04:00
sx={{ userSelect: "none" }}
>
Log In
</Typography>
</Box>
</Stack>
);
};
export default NewPasswordConfirmed;