+
{user.firstName} {user.lastName}
-
{user.email}
+
{user.email}
diff --git a/frontend/src/sign-up/PasswordField.tsx b/frontend/src/sign-up/PasswordField.tsx
index c3dfb499..710108a9 100644
--- a/frontend/src/sign-up/PasswordField.tsx
+++ b/frontend/src/sign-up/PasswordField.tsx
@@ -71,7 +71,7 @@ export default function PasswordField({
{label}
- {required && * }
+ {required && * }
{
const navigate = useNavigate();
const { register } = useAuthContext();
+ const [submitting, setSubmitting] = useState(false);
const [values, setValues] = useState({
firstName: "",
lastName: "",
@@ -36,6 +37,7 @@ const Register = observer(() => {
};
const handleSubmit = async (e: React.FormEvent) => {
+ setSubmitting(true);
e.preventDefault();
if (!EMAIL_REGEX.test(values.email)) {
@@ -77,6 +79,7 @@ const Register = observer(() => {
item: "registration",
});
}
+ setSubmitting(false);
};
return (
@@ -96,6 +99,7 @@ const Register = observer(() => {
values.passwordRe !== ""
}
passwordsMatch={values.password === values.passwordRe}
+ submitting={submitting}
/>
diff --git a/frontend/src/sign-up/SignUpForm.tsx b/frontend/src/sign-up/SignUpForm.tsx
index 8f5266fc..f052325e 100644
--- a/frontend/src/sign-up/SignUpForm.tsx
+++ b/frontend/src/sign-up/SignUpForm.tsx
@@ -16,6 +16,7 @@ export type SignUpFormProps = {
values: SignUpFormValues;
onChange: (field: keyof SignUpFormValues, value: string) => void;
onSubmit: (e: React.FormEvent) => void;
+ submitted?: boolean;
error?: { state: boolean; message: string; item: string };
/** When true, Sign Up button uses primary-900 and is clickable; when false, primary-700 and disabled. */
passwordRequirementsMet?: boolean;
@@ -23,6 +24,8 @@ export type SignUpFormProps = {
allFieldsFilled?: boolean;
/** When true, password and re-enter password are exactly the same. */
passwordsMatch?: boolean;
+ /** When true, form is in the process of being submitted; disables button and shows loading state. */
+ submitting: boolean;
};
/**
@@ -37,6 +40,7 @@ export default function SignUpForm({
passwordRequirementsMet = false,
allFieldsFilled = false,
passwordsMatch = false,
+ submitting = false,
}: SignUpFormProps) {
const hasError = error?.state ?? false;
const errorItem = error?.item ?? "";
@@ -113,7 +117,7 @@ export default function SignUpForm({
)}
-
+
diff --git a/frontend/src/styles/index.css b/frontend/src/styles/index.css
index 6bb4e773..51e946ea 100644
--- a/frontend/src/styles/index.css
+++ b/frontend/src/styles/index.css
@@ -125,10 +125,6 @@ textarea {
border-color: var(--color-primary-900);
}
-button:hover {
- border-color: var(--color-primary-900);
-}
-
@media (prefers-color-scheme: light) {
:root {
color: var(--color-grey-800);
@@ -148,18 +144,25 @@ input {
}
input:focus {
- outline: 2px solid var(--color-primary-900);
+ outline: 0px solid var(--color-primary-900);
/* outline: transparent; */
+ border: 2px solid var(--color-primary-900);
+}
+
+input:-webkit-autofill,
+input:-webkit-autofill:focus {
+ transition: background-color 0s 600000s, color 0s 600000s !important;
}
textarea:focus {
- outline: 2px solid var(--color-primary-900);
+ outline: 0px solid var(--color-primary-900);
/* outline: transparent; */
+ border: 2px solid var(--color-primary-900);
}
button:focus,
button:focus-visible {
- outline: 1px solid var(--color-primary-700);
+ outline: 0px solid var(--color-primary-700);
}
input[type="date"]::-webkit-calendar-picker-indicator {
@@ -183,4 +186,34 @@ input[type="date"]::-webkit-calendar-picker-indicator {
::-webkit-scrollbar-thumb:hover {
background-color: var(--color-grey-500);
+}
+
+input[type="checkbox"] {
+ appearance: none;
+ -webkit-appearance: none;
+ width: 1rem;
+ height: 1rem;
+ border: 2px solid theme('colors.grey.500');
+ border-radius: 50%;
+ cursor: pointer;
+ position: relative;
+ flex-shrink: 0;
+}
+
+input[type="checkbox"]:checked {
+ background-color: theme('colors.primary.900');
+ border-color: theme('colors.primary.900');
+}
+
+input[type="checkbox"]:checked::after {
+ content: '';
+ display: block;
+ position: absolute;
+ left: 50%;
+ top: 45%;
+ transform: translate(-50%, -50%) rotate(45deg);
+ width: 4px;
+ height: 7px;
+ border-right: 2px solid white;
+ border-bottom: 2px solid white;
}
\ No newline at end of file