refactor(auth): replace anchor navigation links with Button components and improve auth page styling
This commit is contained in:
@@ -14,7 +14,7 @@ export default async function AuthPage({ params, searchParams }) {
|
||||
const session = await getSession();
|
||||
|
||||
return (
|
||||
<div className="min-h-screen flex items-center justify-center p-4 md:p-8">
|
||||
<div className="min-h-screen flex items-center justify-center p-4 md:p-8 bg-neutral-50 dark:bg-black">
|
||||
<div className="max-w-md w-full">
|
||||
<AuthPageClient
|
||||
params={params}
|
||||
|
||||
@@ -108,6 +108,7 @@ export default function ForgotPasswordPage({ onSubmit, onNavigate, currentUser =
|
||||
<Button
|
||||
type="submit"
|
||||
variant="primary"
|
||||
size="lg"
|
||||
loading={isLoading}
|
||||
disabled={!!success || !!currentUser}
|
||||
className="w-full mt-2"
|
||||
|
||||
@@ -151,6 +151,7 @@ export default function LoginPage({ onSubmit, onNavigate, onSetSessionCookie, re
|
||||
<Button
|
||||
type="button"
|
||||
variant="primary"
|
||||
size="lg"
|
||||
loading={isLoading}
|
||||
disabled={!!success || !!currentUser}
|
||||
onClick={handleSubmit}
|
||||
@@ -160,18 +161,15 @@ export default function LoginPage({ onSubmit, onNavigate, onSetSessionCookie, re
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<div className={`mt-6 text-center transition-opacity duration-200 ${currentUser ? 'opacity-50 pointer-events-none' : ''}`}>
|
||||
<a
|
||||
href="#"
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
if (!currentUser) onNavigate('register');
|
||||
}}
|
||||
className="group flex items-center justify-center gap-2"
|
||||
<div className={`mt-6 flex justify-center transition-opacity duration-200 ${currentUser ? 'opacity-50 pointer-events-none' : ''}`}>
|
||||
<Button
|
||||
type="button"
|
||||
variant="ghost"
|
||||
disabled={!!currentUser}
|
||||
onClick={() => { if (!currentUser) onNavigate('register'); }}
|
||||
>
|
||||
<span className="text-sm text-neutral-600 dark:text-neutral-400">Pas de compte ? </span>
|
||||
<span className="text-sm text-neutral-900 group-hover:text-neutral-600 font-medium transition-colors duration-200 dark:text-white dark:group-hover:text-neutral-300">S'inscrire</span>
|
||||
</a>
|
||||
Pas de compte ? S'inscrire
|
||||
</Button>
|
||||
</div>
|
||||
</Card>
|
||||
);
|
||||
|
||||
@@ -208,6 +208,7 @@ export default function RegisterPage({ onSubmit, onNavigate, currentUser = null
|
||||
<Button
|
||||
type="submit"
|
||||
variant="primary"
|
||||
size="lg"
|
||||
loading={isLoading}
|
||||
disabled={!!success || !!currentUser || !isFormValid()}
|
||||
className="w-full mt-2"
|
||||
@@ -216,18 +217,15 @@ export default function RegisterPage({ onSubmit, onNavigate, currentUser = null
|
||||
</Button>
|
||||
</form>
|
||||
|
||||
<div className={`mt-6 text-center transition-opacity duration-200 ${currentUser ? 'opacity-50 pointer-events-none' : ''}`}>
|
||||
<a
|
||||
href="#"
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
if (!currentUser) onNavigate('login');
|
||||
}}
|
||||
className="group flex items-center justify-center gap-2"
|
||||
<div className={`mt-6 flex justify-center transition-opacity duration-200 ${currentUser ? 'opacity-50 pointer-events-none' : ''}`}>
|
||||
<Button
|
||||
type="button"
|
||||
variant="ghost"
|
||||
disabled={!!currentUser}
|
||||
onClick={() => { if (!currentUser) onNavigate('login'); }}
|
||||
>
|
||||
<span className="text-sm text-neutral-600 dark:text-neutral-400">Vous avez déjà un compte ? </span>
|
||||
<span className="text-sm text-neutral-900 group-hover:text-neutral-600 font-medium transition-colors duration-200 dark:text-white dark:group-hover:text-neutral-300">Se connecter</span>
|
||||
</a>
|
||||
Vous avez déjà un compte ? Se connecter
|
||||
</Button>
|
||||
</div>
|
||||
</Card>
|
||||
);
|
||||
|
||||
@@ -129,6 +129,7 @@ export default function ResetPasswordPage({ onSubmit, onNavigate, email, token }
|
||||
<Button
|
||||
type="submit"
|
||||
variant="primary"
|
||||
size="lg"
|
||||
loading={isLoading}
|
||||
disabled={!!success || !isFormValid()}
|
||||
className="w-full mt-2"
|
||||
|
||||
@@ -27,29 +27,29 @@ const Button = ({
|
||||
};
|
||||
|
||||
const sizes = {
|
||||
sm: '',
|
||||
sm: 'px-[10px] py-[5px] text-[12px] gap-1',
|
||||
md: 'px-[12px] py-[7px] text-[13px] gap-1.5',
|
||||
lg: ''
|
||||
lg: 'px-[14px] py-[9px] text-[14px] gap-2'
|
||||
};
|
||||
|
||||
const iconOnlySizes = {
|
||||
sm: '',
|
||||
sm: 'p-[5px] text-[12px]',
|
||||
md: 'p-[7px] text-[13px]',
|
||||
lg: ''
|
||||
lg: 'p-[9px] text-[14px]'
|
||||
};
|
||||
|
||||
const isIconOnly = icon && !children;
|
||||
|
||||
const iconSizes = {
|
||||
sm: '',
|
||||
sm: 'w-3.5 h-3.5',
|
||||
md: 'w-4 h-4',
|
||||
lg: ''
|
||||
lg: 'w-4.5 h-4.5'
|
||||
};
|
||||
|
||||
const textSizes = {
|
||||
sm: '',
|
||||
sm: 'min-h-3.5',
|
||||
md: 'min-h-4',
|
||||
lg: ''
|
||||
lg: 'min-h-4.5'
|
||||
};
|
||||
|
||||
const LoadingSpinner = () => (
|
||||
|
||||
Reference in New Issue
Block a user