mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-24 00:55:07 +08:00
🐛 Docs: 修复 wwads 造成的 client 水合不匹配 (#3106)
This commit is contained in:
parent
d766455d13
commit
23bcab5450
@ -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 (
|
||||
<OriginTOCContainer {...props}>
|
||||
{children}
|
||||
<div className="toc-ads-container">
|
||||
<div className="wwads-cn wwads-vertical toc-ads" data-id="281"></div>
|
||||
</div>
|
||||
{isClient && (
|
||||
<div className="toc-ads-container">
|
||||
<div className="wwads-cn wwads-vertical toc-ads" data-id="281"></div>
|
||||
</div>
|
||||
)}
|
||||
</OriginTOCContainer>
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user