From 24870db76f3519d5a6412e0207940d1a7b151dc6 Mon Sep 17 00:00:00 2001 From: TJNhxMZHmqGytuWT <113251528+TJNhxMZHmqGytuWT@users.noreply.github.com> Date: Sat, 21 Sep 2024 22:59:55 +0200 Subject: [PATCH] fix: broken links in Ecosystem page --- components/Nav/SidebarMenus.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/Nav/SidebarMenus.tsx b/components/Nav/SidebarMenus.tsx index 6b55d037..984a716d 100644 --- a/components/Nav/SidebarMenus.tsx +++ b/components/Nav/SidebarMenus.tsx @@ -8,7 +8,7 @@ import Link, { StyledLink } from '../Link'; const { pages } = json; export interface SimpleSidebarMenuProps { - pages?: { title: string; pathname: string; sections: { title: string }[]; href: string }[]; + pages?: { title: string; pathname?: string; sections: { title: string }[]; href: string }[]; } export const SimpleSidebarMenu = ({ pages = [] }: SimpleSidebarMenuProps) => { @@ -91,6 +91,6 @@ export const DocsSidebarMenu = (props: DocsSidebarMenuProps) => { ); }; -function getSectionPath(parentPathname: string, title: string) { - return `${parentPathname}#${titleToDash(title)}`; +function getSectionPath(parentPathname: string | undefined, title: string) { + return `${parentPathname ?? ''}#${titleToDash(title)}`; }