From 9af8b968a84228de254115fe09139bbf6c3ba01a Mon Sep 17 00:00:00 2001 From: Aaron Po Date: Thu, 8 Oct 2026 23:10:48 -0400 Subject: [PATCH] Rework the login and register forms for the split-screen layout --- .../features/auth/components/LoginForm.tsx | 65 ++++---- .../features/auth/components/RegisterForm.tsx | 147 +++++++++--------- 2 files changed, 113 insertions(+), 99 deletions(-) diff --git a/web/frontend/app/features/auth/components/LoginForm.tsx b/web/frontend/app/features/auth/components/LoginForm.tsx index 399fdc07..bceaa87b 100644 --- a/web/frontend/app/features/auth/components/LoginForm.tsx +++ b/web/frontend/app/features/auth/components/LoginForm.tsx @@ -1,8 +1,9 @@ -import { BaseSyntheticEvent } from 'react'; +import { BaseSyntheticEvent, useState } from 'react'; import { FormState, UseFormRegister } from 'react-hook-form'; import FormField from '../../../components/ui/forms/FormField'; import SubmitButton from '../../../components/ui/forms/SubmitButton'; import type { LoginSchema } from '../schemas'; +import ShowPasswordToggle from './ShowPasswordToggle'; interface LoginFormProps { onSubmit: (e?: BaseSyntheticEvent) => Promise | undefined>; @@ -11,34 +12,42 @@ interface LoginFormProps { submitting: boolean; } -const LoginForm = (props: LoginFormProps) => ( -
- +const LoginForm = (props: LoginFormProps) => { + const [showPassword, setShowPassword] = useState(false); - + return ( + + - - -); + + + setShowPassword((shown) => !shown)} + /> + + + + ); +}; export default LoginForm; diff --git a/web/frontend/app/features/auth/components/RegisterForm.tsx b/web/frontend/app/features/auth/components/RegisterForm.tsx index f118d164..71bf9dc6 100644 --- a/web/frontend/app/features/auth/components/RegisterForm.tsx +++ b/web/frontend/app/features/auth/components/RegisterForm.tsx @@ -1,8 +1,9 @@ -import { BaseSyntheticEvent } from 'react'; +import { BaseSyntheticEvent, useState } from 'react'; import { FormState, UseFormRegister } from 'react-hook-form'; import FormField from '../../../components/ui/forms/FormField'; import SubmitButton from '../../../components/ui/forms/SubmitButton'; import type { RegisterSchema } from '../schemas'; +import ShowPasswordToggle from './ShowPasswordToggle'; interface RegisterFormProps { onSubmit: (e?: BaseSyntheticEvent) => Promise | undefined>; @@ -11,87 +12,91 @@ interface RegisterFormProps { submitting: boolean; } -const RegisterForm = (props: RegisterFormProps) => ( -
- +const RegisterForm = (props: RegisterFormProps) => { + const [showPassword, setShowPassword] = useState(false); + + return ( + +
+ + + +
-
-
- + - + - + - + setShowPassword((shown) => !shown)} + /> - - -); + + + ); +}; export default RegisterForm;