diff --git a/src/pages/Login.tsx b/src/pages/Login.tsx index 8181624..2f27756 100644 --- a/src/pages/Login.tsx +++ b/src/pages/Login.tsx @@ -551,154 +551,242 @@ export default function Login() { className={`grid transition-[grid-template-rows] duration-300 ease-in-out ${ showEmailForm ? 'grid-rows-[1fr]' : 'grid-rows-[0fr]' }`} + style={{ transform: 'translateZ(0)' }} > -
+
- {/* Login / Register toggle */} -
- - -
- -
- {/* First name field - only for registration */} - {authMode === 'register' && ( -
- - setFirstName(e.target.value)} - /> + {showForgotPassword ? ( + /* Forgot password screen - replaces login/register */ + forgotPasswordSent ? ( +
+
+ + + +
+

+ {t('auth.checkEmail', 'Check your email')} +

+

+ {t( + 'auth.passwordResetSent', + 'If an account exists with this email, we sent password reset instructions.', + )} +

+
- )} - -
- - setEmail(e.target.value)} - /> -
- -
- - setPassword(e.target.value)} - /> -
- - {/* Confirm password - only for registration */} - {authMode === 'register' && ( -
- - setConfirmPassword(e.target.value)} - /> + ) : ( +
+

+ {t( + 'auth.forgotPasswordHint', + 'Enter your email and we will send you instructions to reset your password.', + )} +

+ +
+ + setForgotPasswordEmail(e.target.value)} + placeholder="you@example.com" + className="input" + autoFocus + /> +
+ {forgotPasswordError && ( +

{forgotPasswordError}

+ )} + + +
+ +
+
+ ) + ) : ( + /* Normal login / register */ + <> +
+ +
- )} - + + + {authMode === 'register' && ( +

+ {t( + 'auth.verificationEmailNotice', + 'After registration, a verification email will be sent to your address', + )} +

)} - - - {/* Verification notice for registration */} - {authMode === 'register' && ( -

- {t( - 'auth.verificationEmailNotice', - 'After registration, a verification email will be sent to your address', + {authMode === 'login' && ( +

+ +
)} -

- )} - - {/* Forgot password link - only for login */} - {authMode === 'login' && ( -
- -
+ )}
@@ -708,111 +796,6 @@ export default function Login() {
)}
- - {/* Forgot Password Modal */} - {showForgotPassword && ( -
-
-
- - - {forgotPasswordSent ? ( -
-
- - - -
-

- {t('auth.checkEmail', 'Check your email')} -

-

- {t( - 'auth.passwordResetSent', - 'If an account exists with this email, we sent password reset instructions.', - )} -

- -
- ) : ( - <> -

- {t('auth.forgotPassword', 'Forgot password?')} -

-

- {t( - 'auth.forgotPasswordHint', - 'Enter your email and we will send you instructions to reset your password.', - )} -

- -
-
- - setForgotPasswordEmail(e.target.value)} - placeholder="you@example.com" - className="input" - autoFocus - /> -
- - {forgotPasswordError && ( -
- {forgotPasswordError} -
- )} - - -
- - )} -
-
- )}
); }