-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cf73c51
commit ade087c
Showing
16 changed files
with
222 additions
and
274 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import React from "react"; | ||
import { useDoc } from "@docusaurus/theme-common/internal"; | ||
import DocItemPaginator from "@theme/DocItem/Paginator"; | ||
import DocVersionBanner from "@theme/DocVersionBanner"; | ||
import DocVersionBadge from "@theme/DocVersionBadge"; | ||
import DocItemFooter from "@theme/DocItem/Footer"; | ||
import DocItemTOCMobile from "@theme/DocItem/TOC/Mobile"; | ||
import DocItemTOCDesktop from "@theme/DocItem/TOC/Desktop"; | ||
import DocItemContent from "@theme/DocItem/Content"; | ||
import DocBreadcrumbs from "@theme/DocBreadcrumbs"; | ||
import type { Props } from "@theme/DocItem/Layout"; | ||
|
||
function useDocTOC() { | ||
const { frontMatter, toc } = useDoc(); | ||
|
||
const hidden = frontMatter.hide_table_of_contents; | ||
const canRender = !hidden && toc.length > 0; | ||
|
||
return canRender; | ||
} | ||
|
||
export default function DocItemLayout({ children }: Props) { | ||
const canRenderTOC = useDocTOC(); | ||
|
||
return ( | ||
<div className="flex lg:divide-x divide-gray-200 dark:divide-gray-800"> | ||
<div className="w-full lg:w-9/12 p-4"> | ||
<DocVersionBanner /> | ||
<div> | ||
<article> | ||
<DocBreadcrumbs /> | ||
<DocVersionBadge /> | ||
{canRenderTOC && <DocItemTOCMobile />} | ||
<DocItemContent>{children}</DocItemContent> | ||
<DocItemFooter /> | ||
</article> | ||
<DocItemPaginator /> | ||
</div> | ||
</div> | ||
{canRenderTOC && ( | ||
<div className="hidden lg:flex lg:w-3/12"> | ||
<DocItemTOCDesktop /> | ||
</div> | ||
)} | ||
</div> | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
27 changes: 0 additions & 27 deletions
27
src/theme/DocPage/Layout/Sidebar/ExpandButton/styles.module.css
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.