Skip to content

Commit 8ad119e

Browse files
Fix: Replace "Retour" button with a link
Replaced the "Retour" button in AuthForm.tsx with a simple link that redirects to https://refspring.com, resolving the page reload issue.
1 parent a8cfcf4 commit 8ad119e

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

src/components/AuthForm.tsx

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import { useState } from 'react';
32
import { Button } from '@/components/ui/button';
43
import { Input } from '@/components/ui/input';
@@ -10,7 +9,6 @@ import { useToast } from '@/hooks/use-toast';
109
import { Chrome, Mail, Lock, ArrowLeft } from 'lucide-react';
1110
import { useTranslation } from 'react-i18next';
1211
import { RefSpringLogo } from '@/components/RefSpringLogo';
13-
import { useNavigate } from 'react-router-dom';
1412

1513
export const AuthForm = () => {
1614
const [isLogin, setIsLogin] = useState(true);
@@ -21,7 +19,6 @@ export const AuthForm = () => {
2119
const { signInWithEmail, signUpWithEmail, signInWithGoogle } = useAuth();
2220
const { toast } = useToast();
2321
const { t } = useTranslation();
24-
const navigate = useNavigate();
2522

2623
const handleSubmit = async (e: React.FormEvent) => {
2724
e.preventDefault();
@@ -71,21 +68,16 @@ export const AuthForm = () => {
7168
}
7269
};
7370

74-
const handleBackToLanding = () => {
75-
navigate('/');
76-
};
77-
7871
return (
7972
<div className="min-h-screen bg-gradient-to-br from-blue-50/50 via-white to-purple-50/50 flex items-center justify-center p-4 relative">
80-
{/* Bouton retour */}
81-
<Button
82-
variant="ghost"
83-
onClick={handleBackToLanding}
84-
className="absolute top-6 left-6 text-slate-600 hover:text-slate-900"
73+
{/* Bouton retour transformé en lien externe */}
74+
<a
75+
href="https://refspring.com"
76+
className="absolute top-6 left-6 inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 hover:bg-accent hover:text-accent-foreground h-10 px-4 py-2 text-slate-600 hover:text-slate-900"
8577
>
8678
<ArrowLeft className="mr-2 h-4 w-4" />
8779
Retour
88-
</Button>
80+
</a>
8981

9082
<Card className="w-full max-w-md bg-white/80 backdrop-blur-sm border-slate-200/50 shadow-xl">
9183
<CardHeader className="text-center pb-6">

0 commit comments

Comments
 (0)