diff --git a/src/components/docPage/index.tsx b/src/components/docPage/index.tsx index 27b1edc817ce6..a174f6c1af366 100644 --- a/src/components/docPage/index.tsx +++ b/src/components/docPage/index.tsx @@ -12,6 +12,7 @@ import {CodeContextProvider} from '../codeContext'; import {GitHubCTA} from '../githubCTA'; import {Header} from '../header'; import {PlatformSdkDetail} from '../platformSdkDetail'; +import {Sidebar} from '../sidebar'; import {TableOfContents} from '../tableOfContents'; type Props = { @@ -29,6 +30,7 @@ export function DocPage({ frontMatter, notoc = false, fullWidth = false, + sidebar, }: Props) { const {rootNode, path} = serverContext(); const currentPlatform = getCurrentPlatform(rootNode, path); @@ -50,6 +52,7 @@ export function DocPage({
+ {sidebar ?? }
; + } + const currentPlatform = getCurrentPlatform(rootNode, path); const currentGuide = getCurrentGuide(rootNode, path); @@ -424,3 +430,553 @@ export function DefaultSidebar({node, path}: DefaultSidebarProps) { ); } + +function DevelopDocsSidebar({path}: {path: string; rootNode: DocNode}) { + return ( + + ); +} diff --git a/src/components/sidebarLink.tsx b/src/components/sidebarLink.tsx index 4e9b468aa4baf..bf9f0e9de1b1f 100644 --- a/src/components/sidebarLink.tsx +++ b/src/components/sidebarLink.tsx @@ -35,14 +35,14 @@ export function SidebarLink({ collapsed = null, className = '', }: SidebarLinkProps) { - const isActive = path.indexOf(to) === 0; + const isActive = path?.indexOf(to) === 0; const enableSubtree = isActive || collapsed === false; const hasSubtree = Children.count(children) > 0; const [showSubtree, setShowSubtree] = useState(enableSubtree); return ( -
  • +