docs: enhanced sidebar context (#4165)

This commit is contained in:
Shahed Nasser
2023-05-24 17:40:13 +03:00
committed by GitHub
parent 0a35f21af7
commit e281469eb8
8 changed files with 124 additions and 77 deletions
+3 -3
View File
@@ -1,16 +1,16 @@
import React, { useContext } from "react"
import React from "react"
import { useDocsSidebar } from "@docusaurus/theme-common/internal"
import Layout from "@theme/Layout"
import BackToTopButton from "@theme/BackToTopButton"
import DocPageLayoutSidebar from "@theme/DocPage/Layout/Sidebar"
import DocPageLayoutMain from "@theme/DocPage/Layout/Main"
import type { Props } from "@theme/DocPage/Layout"
import { SidebarContext } from "@site/src/context/sidebar"
import clsx from "clsx"
import { useSidebar } from "@site/src/providers/Sidebar"
export default function DocPageLayout({ children }: Props): JSX.Element {
const sidebar = useDocsSidebar()
const sidebarContext = useContext(SidebarContext)
const sidebarContext = useSidebar()
return (
<Layout wrapperClassName={clsx("tw-flex tw-flex-[1_0_auto]")}>
<BackToTopButton />