From a6800e433966cc9cac684d9f9511fd7bc351e6ce Mon Sep 17 00:00:00 2001 From: Claudio Wunder Date: Sat, 28 Oct 2023 15:53:55 +0200 Subject: [PATCH 01/14] feat: sidenav support recursive items --- components/SideNavigation.tsx | 16 +++++++++++++--- hooks/useNavigation.tsx | 33 +++++++++++++++++++++++---------- 2 files changed, 36 insertions(+), 13 deletions(-) diff --git a/components/SideNavigation.tsx b/components/SideNavigation.tsx index 7aa43aadf0668..a946370ed23e9 100644 --- a/components/SideNavigation.tsx +++ b/components/SideNavigation.tsx @@ -21,15 +21,25 @@ const SideNavigation: FC = ({ const sideNavigationItems = getSideNavigation(navigationKey, context); - const getLinkClassName = (href: string) => - classNames({ active: isCurrentLocaleRoute(href) }); + const getLinkClasses = (href: string, level: number) => + classNames({ active: isCurrentLocaleRoute(href), level }); return (