From 2f7b2d2b644de95e4db0f2f59021134902a61376 Mon Sep 17 00:00:00 2001 From: Alexis SANOGO Date: Thu, 23 Jul 2026 14:08:04 +0200 Subject: [PATCH] Correction de redirection --- frontend/src/components/Footer.jsx | 73 ++++++++++++++++++------------ frontend/src/components/Header.jsx | 16 +++++-- frontend/src/pages/ReglesJeu.jsx | 18 +++++--- 3 files changed, 66 insertions(+), 41 deletions(-) diff --git a/frontend/src/components/Footer.jsx b/frontend/src/components/Footer.jsx index 604ba0a..9166a48 100644 --- a/frontend/src/components/Footer.jsx +++ b/frontend/src/components/Footer.jsx @@ -1,6 +1,20 @@ -import { Link } from 'react-router-dom' +import { Link, useLocation } from 'react-router-dom' +import { useAuth } from '../context/AuthContext' export default function Footer() { + const { pathname } = useLocation() + const { user } = useAuth() + const isLoggedIn = !!user + + function FooterLink({ to, children, className=''}) { + return pathname === to ? ( + {children} + ) : ( + + {children} + + ) + } return (