mirror of
https://github.com/Snigdha-OS/documentation.git
synced 2025-09-14 20:24:56 +02:00
34 lines
1.2 KiB
JavaScript
34 lines
1.2 KiB
JavaScript
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
import React, {useState} from 'react';
|
|
import {useDocsSidebar} from '@docusaurus/theme-common/internal';
|
|
import BackToTopButton from '@theme/BackToTopButton';
|
|
import DocRootLayoutSidebar from '@theme/DocRoot/Layout/Sidebar';
|
|
import DocRootLayoutMain from '@theme/DocRoot/Layout/Main';
|
|
import styles from './styles.module.css';
|
|
export default function DocRootLayout({children}) {
|
|
const sidebar = useDocsSidebar();
|
|
const [hiddenSidebarContainer, setHiddenSidebarContainer] = useState(false);
|
|
return (
|
|
<div className={styles.docsWrapper}>
|
|
<BackToTopButton />
|
|
<div className={styles.docRoot}>
|
|
{sidebar && (
|
|
<DocRootLayoutSidebar
|
|
sidebar={sidebar.items}
|
|
hiddenSidebarContainer={hiddenSidebarContainer}
|
|
setHiddenSidebarContainer={setHiddenSidebarContainer}
|
|
/>
|
|
)}
|
|
<DocRootLayoutMain hiddenSidebarContainer={hiddenSidebarContainer}>
|
|
{children}
|
|
</DocRootLayoutMain>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|