diff --git a/website/app/components/[id]/layout.tsx b/website/app/components/[id]/layout.tsx index d62ffe3a44..0ca16d58a5 100644 --- a/website/app/components/[id]/layout.tsx +++ b/website/app/components/[id]/layout.tsx @@ -20,7 +20,7 @@ const Layout = ({ children, params }: LayoutProps) => { return ( - +
{getName(id)} diff --git a/website/build-app/components/Sidebar/index.tsx b/website/build-app/components/Sidebar/index.tsx index 867ef14db5..b4e901e0fc 100644 --- a/website/build-app/components/Sidebar/index.tsx +++ b/website/build-app/components/Sidebar/index.tsx @@ -11,9 +11,10 @@ import { getName } from '@/build-app/utils/transform-name' type SidebarProps = { menu: PageTree + isSubPage?: boolean } -export const Sidebar = ({ menu }: SidebarProps) => { +export const Sidebar = ({ isSubPage, menu }: SidebarProps) => { const currentRoute = usePathname() return ( @@ -38,10 +39,11 @@ export const Sidebar = ({ menu }: SidebarProps) => { {pages.map(({ id, name, parent: pageParent }) => { const href = `/${parent}/${pageParent ? `${pageParent}/` : ''}${id}` + const isCurrent = isSubPage ? currentRoute.startsWith(href) : currentRoute === href return (
  • - + {name || getName(id)}