Skip to content

Commit 4f1ebaa

Browse files
Merge pull request #141 from pierrick-fonquerne/139-fixfrontend-les-boutons-du-hero-de-la-page-daccueil-ne-mènent-nulle-part
fix(frontend): add navigation to Hero CTA buttons (#139)
2 parents d96579d + 9528f2b commit 4f1ebaa

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

src/frontend/src/components/home/HeroSection.tsx

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1+
import { Link } from 'react-router-dom';
2+
import { useAuth } from '../../context/AuthContext';
13
import { Button } from '../ui';
24

35
const HeroSection = () => {
6+
const { isAuthenticated } = useAuth();
7+
48
return (
59
<section className="relative py-16 lg:py-24 overflow-hidden">
610
<div className="absolute inset-0 bg-gradient-to-b from-dark-900 via-dark-950 to-dark-900" />
@@ -21,12 +25,16 @@ const HeroSection = () => {
2125
</p>
2226

2327
<div className="flex flex-col sm:flex-row gap-4 justify-center lg:justify-start">
24-
<Button size="lg">
25-
Créer un personnage
26-
</Button>
27-
<Button variant="outline" size="lg">
28-
Explorer la galerie
29-
</Button>
28+
<Link to={isAuthenticated ? '/characters/create' : '/register'}>
29+
<Button size="lg">
30+
Créer un personnage
31+
</Button>
32+
</Link>
33+
<Link to="/galerie">
34+
<Button variant="outline" size="lg">
35+
Explorer la galerie
36+
</Button>
37+
</Link>
3038
</div>
3139
</div>
3240

0 commit comments

Comments
 (0)