Refactored checks component

This commit is contained in:
Daniel Cojocea committed 2024-07-15 20:14:32 -04:00
1 parent 4db0beecd8
commit fdac37b595
7 files changed
+92 -31

No files matched your search

+1 -1
View File
@@ -16,7 +16,7 @@
color: var(--env-var-color-2);
opacity: 0.8;
}
.login-page button {
.login-page button:not(.MuiIconButton-root) {
height: 34px;
border-radius: var(--env-var-radius-2);
line-height: 0;
+7 -1
View File
@@ -18,7 +18,7 @@
color: var(--env-var-color-2);
opacity: 0.8;
}
.register-page button {
.register-page button:not(.MuiIconButton-root) {
height: 34px;
border-radius: var(--env-var-radius-2);
line-height: 0;
@@ -26,6 +26,12 @@
.register-page svg rect {
fill: none;
}
.register-page
.MuiFormControl-root:has(#register-password-input)
+ span.MuiTypography-root {
display: none;
visibility: hidden;
}
.register-form {
margin-top: 102px;
+38 -3
View File
@@ -199,9 +199,44 @@ const Register = () => {
error={errors.confirm}
/>
<Stack gap={theme.gap.small}>
<Check text="Must be at least 8 characters" />
<Check text="Must contain one special character" />
<Check text="Must contain at least one upper and lower character" />
<Check
text="Must be at least 8 characters long"
variant={
errors?.password === "Password is required"
? "error"
: form.password === ""
? "info"
: form.password.length < 8
? "error"
: "success"
}
/>
<Check
text="Must contain one special character and a number"
variant={
errors?.password === "Password is required"
? "error"
: form.password === ""
? "info"
: !/^(?=.*[!@#$%^&*(),.?":{}|])(?=.*\d).+$/.test(
form.password
)
? "error"
: "success"
}
/>
<Check
text="Must contain at least one upper and lower character"
variant={
errors?.password === "Password is required"
? "error"
: form.password === ""
? "info"
: !/^(?=.*[A-Z])(?=.*[a-z]).+$/.test(form.password)
? "error"
: "success"
}
/>
</Stack>
<Button
type="submit"