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}