Added forgot password button

This commit is contained in:
Daniel Cojocea committed 2024-08-09 16:16:21 -04:00
1 parent cac19d3130
commit 72bc3a5652
2 files changed
+31 -14

No files matched your search

+19 -2
View File
@@ -144,6 +144,7 @@ const StepOne = ({ form, errors, onSubmit, onChange, onBack }) => {
*/ */
const StepTwo = ({ form, errors, onSubmit, onChange, onBack }) => { const StepTwo = ({ form, errors, onSubmit, onChange, onBack }) => {
const theme = useTheme(); const theme = useTheme();
const navigate = useNavigate();
const inputRef = useRef(null); const inputRef = useRef(null);
useEffect(() => { useEffect(() => {
@@ -194,10 +195,23 @@ const StepTwo = ({ form, errors, onSubmit, onChange, onBack }) => {
level="primary" level="primary"
label="Continue" label="Continue"
onClick={onSubmit} onClick={onSubmit}
disabled={errors.email && true} disabled={errors.password && true}
sx={{ width: "30%" }} sx={{ width: "30%" }}
/> />
</Stack> </Stack>
<Box textAlign="center">
<Typography className="forgot-p" display="inline-block">
Forgot password?
</Typography>
<Typography
component="span"
ml={theme.gap.xs}
sx={{ userSelect: "none" }}
onClick={() => navigate("/forgot-password")}
>
Reset password
</Typography>
</Box>
</Stack> </Stack>
</> </>
); );
@@ -292,6 +306,9 @@ const Login = () => {
body: "Welcome back! You're successfully logged in.", body: "Welcome back! You're successfully logged in.",
}); });
} else { } else {
setErrors({
password: "The password you provided does not match our records",
});
if (action.payload) { if (action.payload) {
// dispatch errors // dispatch errors
createToast({ createToast({
@@ -368,7 +385,7 @@ const Login = () => {
)} )}
</Stack> </Stack>
<Box textAlign="center" p={theme.gap.large}> <Box textAlign="center" p={theme.gap.large}>
<Typography display="inline-block">Don't have an account? -</Typography> <Typography display="inline-block">Don't have an account? —</Typography>
<Typography <Typography
component="span" component="span"
ml={theme.gap.xs} ml={theme.gap.xs}
+12 -12
View File
@@ -116,17 +116,22 @@
font-weight: 600; font-weight: 600;
color: var(--env-var-color-3); color: var(--env-var-color-3);
} }
.login-page button:not(.MuiIconButton-root),
.login-page .field h3.MuiTypography-root,
.login-page .field input,
.login-page .field .input-error
.login-page p,
.login-page .forgot-p + span {
font-size: var(--env-var-font-size-medium-plus);
}
.login-page p { .login-page p {
font-size: var(--env-var-font-size-large);
color: var(--env-var-color-2-light); color: var(--env-var-color-2-light);
} }
.login-page .field h3.MuiTypography-root, .login-page .field h3.MuiTypography-root,
.login-page .field input { .login-page .field input {
color: var(--env-var-color-5); color: var(--env-var-color-5);
} }
.login-page .tos-p {
font-size: var(--env-var-font-size-medium-plus);
}
.login-page span { .login-page span {
font-size: inherit; font-size: inherit;
} }
@@ -149,25 +154,20 @@
.login-page p + span:hover { .login-page p + span:hover {
opacity: 1; opacity: 1;
} }
.login-page button:not(.MuiIconButton-root),
.login-page .field h3.MuiTypography-root,
.login-page .field input,
.login-page .field .input-error {
font-size: var(--env-var-font-size-medium-plus);
}
.login-page button:not(.MuiIconButton-root) { .login-page button:not(.MuiIconButton-root) {
user-select: none;
border-radius: var(--env-var-radius-2); border-radius: var(--env-var-radius-2);
line-height: 1; line-height: 1;
} }
.login-page button:not(.MuiIconButton-root), .login-page button:not(.MuiIconButton-root),
.login-page .field .MuiInputBase-root:has(input) { .login-page .field .MuiInputBase-root:has(input) {
height: 40px; height: 38px;
} }
.login-page .field svg { .login-page .field svg {
width: 24px; width: 24px;
height: 24px; height: 24px;
} }
.login-page .field .MuiIconButton-root{ .login-page .field .MuiIconButton-root {
padding: 4px; padding: 4px;
} }