From 01025d594a41dfd3a4d82da4713390ecfb13111b Mon Sep 17 00:00:00 2001 From: Ju4tCode <42488585+yanyongyu@users.noreply.github.com> Date: Wed, 27 Sep 2023 08:51:40 +0000 Subject: [PATCH] :bug: Fix sidebar and toc ssr --- packages/theme-nonepress/src/theme/Sidebar/index.tsx | 2 +- packages/theme-nonepress/src/theme/TOC/index.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/theme-nonepress/src/theme/Sidebar/index.tsx b/packages/theme-nonepress/src/theme/Sidebar/index.tsx index 28790ff..5ff383f 100644 --- a/packages/theme-nonepress/src/theme/Sidebar/index.tsx +++ b/packages/theme-nonepress/src/theme/Sidebar/index.tsx @@ -32,7 +32,7 @@ import SidebarContent from "@theme/Sidebar/Content"; export default function Sidebar({ className }: Props): JSX.Element | null { const { pathname } = useLocation(); const windowSize = useWindowSize(); - const isMobile = windowSize === "mobile" || windowSize === "ssr"; + const isMobile = windowSize === "mobile"; // const showAnnouncementBar = useShowAnnouncementBar(); const { diff --git a/packages/theme-nonepress/src/theme/TOC/index.tsx b/packages/theme-nonepress/src/theme/TOC/index.tsx index e4ad071..2fba63f 100644 --- a/packages/theme-nonepress/src/theme/TOC/index.tsx +++ b/packages/theme-nonepress/src/theme/TOC/index.tsx @@ -9,7 +9,7 @@ import TOCContent from "@theme/TOC/Content"; export default function TOC({ className }: Props): JSX.Element | null { const windowSize = useWindowSize(); - const isMobile = windowSize === "mobile" || windowSize === "ssr"; + const isMobile = windowSize === "mobile"; const [tocContent] = useTOCContent();