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 && ( +
+
+
+ )}
); }