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

121 lines
3.5 KiB
React
Raw Normal View History

2024-08-31 17:37:55 -04:00
import { Box, Button, 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-09-06 17:14:23 -04:00
import { IconBox } from "./styled";
import Background from "../../assets/Images/background-grid.svg?react";
import ConfirmIcon from "../../assets/icons/check-outlined.svg?react";
2024-08-12 15:35:36 -04:00
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.primary.main,
2024-08-27 20:11:59 -04:00
fontWeight: 600,
2024-09-06 17:14:23 -04:00
fontSize: 21,
2024-08-27 20:11:59 -04:00
},
2024-09-06 17:14:23 -04:00
"& p": { fontSize: 13.5, color: theme.palette.text.accent },
2024-08-27 20:11:59 -04:00
}}
>
<Box
2024-07-17 17:44:29 -04:00
className="background-pattern-svg"
2024-09-06 17:14:23 -04:00
sx={{
"& svg g g:last-of-type path": {
stroke: theme.palette.border.light,
},
}}
>
<Background style={{ width: "100%" }} />
</Box>
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>
2024-09-06 17:14:23 -04:00
<IconBox>
<ConfirmIcon alt="password confirm icon" />
</IconBox>
<Typography component="h1">Password reset</Typography>
2024-09-06 17:14:23 -04:00
<Typography mb={theme.spacing(2)}>
Your password has been successfully reset. Click below to log in
magically.
</Typography>
</Box>
<Button
2024-08-31 17:37:55 -04:00
variant="contained"
color="primary"
onClick={() => navigate("/monitors")}
sx={{
width: "100%",
maxWidth: 400,
}}
2024-08-31 17:37:55 -04:00
>
Continue
</Button>
</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"
color={theme.palette.primary.main}
2024-08-27 20:11:59 -04:00
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;