From 75ebaf8f06a9500e825017ad43904664781b885d Mon Sep 17 00:00:00 2001 From: Hossein Mehrabi Date: Sun, 9 Oct 2022 16:51:03 +0330 Subject: [PATCH] temp --- src/theme/Layout/index.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/theme/Layout/index.tsx b/src/theme/Layout/index.tsx index d2eea71..df8d57e 100644 --- a/src/theme/Layout/index.tsx +++ b/src/theme/Layout/index.tsx @@ -1,10 +1,19 @@ +import { useLocation } from '@docusaurus/router' +import useDocusaurusContext from '@docusaurus/useDocusaurusContext' import { globalStore } from '@site/src/containers/GlobalStore' import Layout from '@theme-original/Layout' import React from 'react' import './styles.scss' export default function LayoutWrapper(props) { - const store = globalStore.useCreateStore({ hiddenSidebar: false }) + const { pathname } = useLocation() + const { + siteConfig: { baseUrl }, + } = useDocusaurusContext() + + const store = globalStore.useCreateStore({ + hiddenSidebar: pathname === baseUrl, + }) return (