@@ -2,6 +2,9 @@ import { useMemo, useCallback } from "react";
22import { useRouter } from "next/router" ;
33import { getMDXExport } from "mdx-bundler/client"
44
5+ import Navbar from "@/components/Navbar" ;
6+ import Sidebar from "@/components/Sidebar" ;
7+ import TocDesktop from "@/components/Toc/Desktop" ;
58import MainWrapper from "@/layout/components/MainWrapper" ;
69import SidebarContainer from "@/layout/components/SidebarContainer" ;
710import ContentWrapper from "@/layout/components/ContentWrapper" ;
@@ -10,9 +13,7 @@ import TocContainer from "@/layout/components/TocContainer";
1013import BeforeMarkdown from "@/layout/components/BeforeMarkdown" ;
1114import OpenInColab from "@/layout/components/OpenInColab" ;
1215import MarkdownWrapper from "@/layout/components/MarkdownWrapper" ;
13- import Navbar from "@/components/Navbar" ;
14- import Sidebar from "@/components/Sidebar" ;
15- import TocDesktop from "@/components/Toc/Desktop" ;
16+ import PageProvider from "@/layout/context/Page" ;
1617import components from "@/mdx/components" ;
1718
1819import type { DocPageProps } from "@/layout/pages/types" ;
@@ -26,10 +27,12 @@ export default function DocPage ({ slug, fsPath, sidebar, code }: DocPageProps)
2627 ) , [ Component ] )
2728
2829 return (
29- < >
30+ < PageProvider sidebar = { sidebar } toc = { toc } >
3031 < Navbar sidebar = { sidebar } path = { asPath } />
3132 < MainWrapper >
32- < SidebarContainer > < Sidebar items = { sidebar } activePath = { asPath } /> </ SidebarContainer >
33+ < SidebarContainer >
34+ < Sidebar items = { sidebar } activePath = { asPath } />
35+ </ SidebarContainer >
3336 < ContentWrapper >
3437 < ContentContainer >
3538 < BeforeMarkdown >
@@ -44,6 +47,6 @@ export default function DocPage ({ slug, fsPath, sidebar, code }: DocPageProps)
4447 </ TocContainer >
4548 </ ContentWrapper >
4649 </ MainWrapper >
47- </ >
50+ </ PageProvider >
4851 )
4952}
0 commit comments