diff --git a/packages/web/src/pages/Register.tsx b/packages/web/src/pages/Register.tsx index a5c0ef1..b8ffad1 100644 --- a/packages/web/src/pages/Register.tsx +++ b/packages/web/src/pages/Register.tsx @@ -1,6 +1,9 @@ import { useState } from 'react'; import { Link, useNavigate } from 'react-router-dom'; import { useAuth } from '../lib/auth'; +import { useI18n } from '../lib/i18n'; +import AuthBranding from '../components/AuthBranding'; +import OAuthButtons from '../components/OAuthButtons'; export default function Register() { const [name, setName] = useState(''); @@ -11,6 +14,7 @@ export default function Register() { const [loading, setLoading] = useState(false); const { register } = useAuth(); const navigate = useNavigate(); + const { t } = useI18n(); const clearFieldError = (field: string) => { if (fieldErrors[field as keyof typeof fieldErrors]) { @@ -20,9 +24,7 @@ export default function Register() { const validate = () => { const errors: { name?: string; email?: string; password?: string } = {}; - if (!name.trim()) { - errors.name = 'Name is required'; - } + if (!name.trim()) errors.name = 'Name is required'; if (!email.trim()) { errors.email = 'Email is required'; } else if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)) { @@ -55,94 +57,119 @@ export default function Register() { const errorInputClass = 'border-danger! focus:border-danger! focus:shadow-[0_0_0_3px_var(--danger-muted)]!'; return ( -
-
-
+
+ {/* Left panel — branding (hidden on mobile) */} + -
-
-
- - - + {/* Right panel — form */} +
+
+
+ +
+ {/* Mobile-only brand */} +
+
+ + + + + +
+

{t('auth.productName')}

+

{t('auth.slogan')}

-

Create your account

-

Get started with AgentFox

-
-
- {error && ( -
- - {error} -
- )} -
-
- - { setName(e.target.value); clearFieldError('name'); }} - className={`input-base ${fieldErrors.name ? errorInputClass : ''}`} - placeholder="Your name" - /> - {fieldErrors.name && ( -

- - {fieldErrors.name} -

- )} -
-
- - { setEmail(e.target.value); clearFieldError('email'); }} - className={`input-base ${fieldErrors.email ? errorInputClass : ''}`} - placeholder="you@example.com" - /> - {fieldErrors.email && ( -

- - {fieldErrors.email} -

- )} -
-
- - { setPassword(e.target.value); clearFieldError('password'); }} - className={`input-base ${fieldErrors.password ? errorInputClass : ''}`} - placeholder="At least 8 characters" - /> - {fieldErrors.password && ( -

- - {fieldErrors.password} -

- )} -
- -
-
+ {/* Title (desktop) */} +
+

{t('auth.register.title')}

+

{t('auth.register.subtitle')}

+
-

- Already have an account?{' '} - Sign In -

+
+ {error && ( +
+ + {error} +
+ )} +
+
+ + { setName(e.target.value); clearFieldError('name'); }} + className={`input-base ${fieldErrors.name ? errorInputClass : ''}`} + placeholder="Your name" + /> + {fieldErrors.name && ( +

+ + {fieldErrors.name} +

+ )} +
+
+ + { setEmail(e.target.value); clearFieldError('email'); }} + className={`input-base ${fieldErrors.email ? errorInputClass : ''}`} + placeholder="you@example.com" + /> + {fieldErrors.email && ( +

+ + {fieldErrors.email} +

+ )} +
+
+ + { setPassword(e.target.value); clearFieldError('password'); }} + className={`input-base ${fieldErrors.password ? errorInputClass : ''}`} + placeholder="At least 8 characters" + /> + {fieldErrors.password && ( +

+ + {fieldErrors.password} +

+ )} +
+ +
+ + {/* Divider */} +
+
+ {t('auth.register.or')} +
+
+ + {/* OAuth buttons */} + +
+ +

+ {t('auth.register.hasAccount')}{' '} + {t('auth.register.signIn')} +

+
);