feat: Add last sections to Navigation component
This commit is contained in:
parent
229e28737f
commit
8a393c53bf
@ -161,6 +161,7 @@ export function Navigation({
|
||||
onLinkClick?: React.MouseEventHandler<HTMLAnchorElement>;
|
||||
}) {
|
||||
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({
|
||||
))}
|
||||
</li>
|
||||
))}
|
||||
<li>
|
||||
<h2 className="font-display font-bold text-base text-slate-900 dark:text-white">{lastSections[0]?.type}</h2>
|
||||
{lastSections.map((section) => (
|
||||
<NavigationItem key={section.title} section={section} onLinkClick={onLinkClick} />
|
||||
))}
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
);
|
||||
|
||||
@ -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,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user