From 1c68b2bc0d948113209c911bde07049bdf202db4 Mon Sep 17 00:00:00 2001 From: Alexis SANOGO Date: Thu, 23 Jul 2026 15:06:14 +0200 Subject: [PATCH] =?UTF-8?q?condition=20d'affichage=20reserv=C3=A9=20=C3=A0?= =?UTF-8?q?=20l'admin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/pages/Sitemap.jsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/src/pages/Sitemap.jsx b/frontend/src/pages/Sitemap.jsx index f90c3f6..c6e76e7 100644 --- a/frontend/src/pages/Sitemap.jsx +++ b/frontend/src/pages/Sitemap.jsx @@ -1,4 +1,5 @@ import { Link } from 'react-router-dom' +import { useAuth} from '../context/AuthContext' const sections = [ { @@ -41,6 +42,11 @@ const sections = [ ] export default function Sitemap() { + const { user } = useAuth() + const isAdmin = user?.role === 'admin' + const visibleSections = sections.filter( + (section) => section.title !== 'Espaces professionnels' || isAdmin + ) return (
@@ -55,7 +61,7 @@ export default function Sitemap() {
- {sections.map((section) => ( + {visibleSections.map((section) => (

{section.title}