Last night

This commit is contained in:
Andras Schmelczer 2026-02-08 10:21:37 +00:00
parent 2906b01734
commit 42ee2d4c51
47 changed files with 848 additions and 478 deletions

View file

@ -15,7 +15,7 @@ export default function AuthModal({
}: {
onClose: () => void;
onLogin: (email: string, password: string) => Promise<void>;
onRegister: (email: string, password: string, name?: string) => Promise<void>;
onRegister: (email: string, password: string) => Promise<void>;
onForgotPassword: (email: string) => Promise<void>;
loading: boolean;
error: string | null;
@ -25,7 +25,6 @@ export default function AuthModal({
const [view, setView] = useState<View>(initialTab);
const [email, setEmail] = useState('');
const [password, setPassword] = useState('');
const [name, setName] = useState('');
const [resetSent, setResetSent] = useState(false);
const switchView = useCallback(
@ -45,7 +44,7 @@ export default function AuthModal({
await onLogin(email, password);
onClose();
} else if (view === 'register') {
await onRegister(email, password, name || undefined);
await onRegister(email, password);
onClose();
} else {
await onForgotPassword(email);
@ -55,7 +54,7 @@ export default function AuthModal({
// Error is handled by the hook
}
},
[view, email, password, name, onLogin, onRegister, onForgotPassword, onClose]
[view, email, password, onLogin, onRegister, onForgotPassword, onClose]
);
const title =
@ -107,21 +106,6 @@ export default function AuthModal({
{/* Form */}
<form onSubmit={handleSubmit} className="p-5 space-y-4">
{view === 'register' && (
<div>
<label className="block text-sm font-medium text-warm-700 dark:text-warm-300 mb-1">
Name
</label>
<input
type="text"
value={name}
onChange={(e) => setName(e.target.value)}
className="w-full px-3 py-2 text-sm rounded border border-warm-200 dark:border-warm-700 bg-white dark:bg-warm-900 text-navy-950 dark:text-white placeholder-warm-400 dark:placeholder-warm-500 outline-none focus:ring-2 ring-teal-400 dark:ring-teal-500"
placeholder="Your name (optional)"
/>
</div>
)}
<div>
<label className="block text-sm font-medium text-warm-700 dark:text-warm-300 mb-1">
Email