From 8a393c53bf51ac70aeb35e9a5166ce6c6eff3d6f Mon Sep 17 00:00:00 2001 From: GauthierWebDev Date: Fri, 18 Apr 2025 15:47:03 +0200 Subject: [PATCH] feat: Add last sections to Navigation component --- app/components/syntax/Navigation.tsx | 7 +++++++ app/lib/navigation.ts | 12 +++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/app/components/syntax/Navigation.tsx b/app/components/syntax/Navigation.tsx index daa77b7..1a1e99f 100644 --- a/app/components/syntax/Navigation.tsx +++ b/app/components/syntax/Navigation.tsx @@ -161,6 +161,7 @@ export function Navigation({ onLinkClick?: React.MouseEventHandler; }) { const firstSections = navigation.filter((section) => section.position === "start"); + const lastSections = navigation.filter((section) => section.position === "end"); const filteredSections = navigation .filter((section) => section.position === "auto" || section.position === undefined) @@ -192,6 +193,12 @@ export function Navigation({ ))} ))} +
  • +

    {lastSections[0]?.type}

    + {lastSections.map((section) => ( + + ))} +
  • ); diff --git a/app/lib/navigation.ts b/app/lib/navigation.ts index c584b75..a74b5e2 100644 --- a/app/lib/navigation.ts +++ b/app/lib/navigation.ts @@ -2,12 +2,13 @@ const navigationsTypes = { GLOBAL: "👋 Général", CERTIFICATIONS: "🎓 Certifications", DOCUMENTATIONS: "📚 Documentations", + OTHER: "🔗 Autres", }; export type NavigationSection = { title: string; type: (typeof navigationsTypes)[keyof typeof navigationsTypes]; - position: "start" | "auto"; + position: "start" | "end" | "auto"; links: NavigationLink[]; }; @@ -47,6 +48,15 @@ export const navigation: NavigationSection[] = [ { title: "Partages et réutilisations", href: "/docs/communaute/partages", subitems: [] }, ], }, + { + title: "Légal", + type: navigationsTypes.OTHER, + position: "end", + links: [ + { title: "Mentions légales", href: "/mentions-legales", subitems: [] }, + { title: "Politique de confidentialité", href: "/politique-de-confidentialite", subitems: [] }, + ], + }, { title: "Développeur Web et Web Mobile", type: navigationsTypes.CERTIFICATIONS,