From 23bcab5450eae558ae38aef46a65b174df658dd5 Mon Sep 17 00:00:00 2001 From: StarHeart Date: Mon, 4 Nov 2024 16:07:50 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20Docs:=20=E4=BF=AE=E5=A4=8D=20wwads=20?= =?UTF-8?q?=E9=80=A0=E6=88=90=E7=9A=84=20client=20=E6=B0=B4=E5=90=88?= =?UTF-8?q?=E4=B8=8D=E5=8C=B9=E9=85=8D=20(#3106)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- website/src/theme/Page/TOC/Container/index.tsx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/website/src/theme/Page/TOC/Container/index.tsx b/website/src/theme/Page/TOC/Container/index.tsx index f4399198..efc61938 100644 --- a/website/src/theme/Page/TOC/Container/index.tsx +++ b/website/src/theme/Page/TOC/Container/index.tsx @@ -1,19 +1,26 @@ import React from "react"; -import "./styles.css"; +import { useWindowSize } from "@nullbot/docusaurus-theme-nonepress/client"; + import type { Props } from "@theme/Page/TOC/Container"; import OriginTOCContainer from "@theme-original/Page/TOC/Container"; +import "./styles.css"; export default function TOCContainer({ children, ...props }: Props): JSX.Element { + const windowSize = useWindowSize(); + const isClient = windowSize !== "ssr"; + return ( {children} -
-
-
+ {isClient && ( +
+
+
+ )}
); }