mirror of
https://gitea.com/gitea/docs.git
synced 2026-06-25 21:56:22 +00:00
Reviewed-on: https://gitea.com/gitea/docs/pulls/118 Co-authored-by: Renovate Bot <renovate-bot@gitea.com> Co-committed-by: Renovate Bot <renovate-bot@gitea.com>
37 lines
1.4 KiB
JavaScript
37 lines
1.4 KiB
JavaScript
// Ejected unsafe, need to check if this changes and maintain this component
|
|
// https://github.com/facebook/docusaurus/blob/docusaurus-v2/packages/docusaurus-theme-classic/src/theme/DocPage/Layout/index.tsx
|
|
import React, {useState} from 'react';
|
|
import {useDocsSidebar} from '@docusaurus/plugin-content-docs/client';
|
|
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 styles from './styles.module.css';
|
|
import { ActionFooter } from "@site/src/components/ActionFooter";
|
|
import { Section } from "@site/src/components/Section";
|
|
|
|
export default function DocPageLayout({children}) {
|
|
const sidebar = useDocsSidebar();
|
|
const [hiddenSidebarContainer, setHiddenSidebarContainer] = useState(false);
|
|
return (
|
|
<Layout wrapperClassName={styles.docsWrapper}>
|
|
<BackToTopButton />
|
|
<div className={styles.docPage}>
|
|
{sidebar && (
|
|
<DocPageLayoutSidebar
|
|
sidebar={sidebar.items}
|
|
hiddenSidebarContainer={hiddenSidebarContainer}
|
|
setHiddenSidebarContainer={setHiddenSidebarContainer}
|
|
/>
|
|
)}
|
|
<DocPageLayoutMain hiddenSidebarContainer={hiddenSidebarContainer}>
|
|
{children}
|
|
</DocPageLayoutMain>
|
|
</div>
|
|
<Section>
|
|
<ActionFooter />
|
|
</Section>
|
|
</Layout>
|
|
);
|
|
}
|