From e961ce404274c55b9f90e702e4ef55889a5c5042 Mon Sep 17 00:00:00 2001 From: Aaron Po Date: Tue, 13 Oct 2026 01:32:36 -0400 Subject: [PATCH] Move the login page onto the split-screen shell --- .../features/auth/components/LoginForm.tsx | 65 +++++++++++-------- .../auth/components/RegisterCallout.tsx | 23 ------- .../app/features/auth/routes/login.tsx | 45 +++++-------- 3 files changed, 55 insertions(+), 78 deletions(-) delete mode 100644 web/frontend/app/features/auth/components/RegisterCallout.tsx 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/RegisterCallout.tsx b/web/frontend/app/features/auth/components/RegisterCallout.tsx deleted file mode 100644 index d0317bae..00000000 --- a/web/frontend/app/features/auth/components/RegisterCallout.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import { HomeSimpleDoor, UserPlus } from 'iconoir-react'; -import { Link } from 'react-router'; - -const RegisterCallout = () => ( - <> -
New here?
-
- -
- -); - -export default RegisterCallout; diff --git a/web/frontend/app/features/auth/routes/login.tsx b/web/frontend/app/features/auth/routes/login.tsx index 5178e7af..3d482539 100644 --- a/web/frontend/app/features/auth/routes/login.tsx +++ b/web/frontend/app/features/auth/routes/login.tsx @@ -1,10 +1,12 @@ import { zodResolver } from '@hookform/resolvers/zod'; -import { LogIn } from 'iconoir-react'; import { useForm } from 'react-hook-form'; import { redirect, useNavigation, useSubmit } from 'react-router'; import { createAuthSession, getOptionalAuth, login } from '../auth.server'; +import AuthCardHeading from '../components/AuthCardHeading'; +import AuthErrorAlert from '../components/AuthErrorAlert'; +import AuthSplitLayout from '../components/AuthSplitLayout'; +import AuthSwitchPrompt from '../components/AuthSwitchPrompt'; import LoginForm from '../components/LoginForm'; -import RegisterCallout from '../components/RegisterCallout'; import { useActionErrorToast } from '../hooks/useActionErrorToast'; import { loginSchema, type LoginSchema } from '../schemas'; import type { Route } from './+types/login'; @@ -54,34 +56,23 @@ const Login = ({ actionData }: Route.ComponentProps) => { useActionErrorToast(actionData?.error); return ( -
-
-
-
-

-

-

Sign in to your Biergarten account

-
+ + - {actionData?.error && ( -
- {actionData.error} -
- )} + {actionData?.error && } - + - -
-
-
+ + ); };