Files
gitea-docs/src/theme/DocPage/Layout/index.js
Renovate Bot 3c21d98474 fix(deps): update docusaurus monorepo to v3.7.0 (#118)
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>
2025-01-10 16:20:11 +00:00

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>
);
}