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 React from "react";
|
||||||
|
|
||||||
import "./styles.css";
|
import { useWindowSize } from "@nullbot/docusaurus-theme-nonepress/client";
|
||||||
|
|
||||||
import type { Props } from "@theme/Page/TOC/Container";
|
import type { Props } from "@theme/Page/TOC/Container";
|
||||||
import OriginTOCContainer from "@theme-original/Page/TOC/Container";
|
import OriginTOCContainer from "@theme-original/Page/TOC/Container";
|
||||||
|
import "./styles.css";
|
||||||
|
|
||||||
export default function TOCContainer({
|
export default function TOCContainer({
|
||||||
children,
|
children,
|
||||||
...props
|
...props
|
||||||
}: Props): JSX.Element {
|
}: Props): JSX.Element {
|
||||||
|
const windowSize = useWindowSize();
|
||||||
|
const isClient = windowSize !== "ssr";
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<OriginTOCContainer {...props}>
|
<OriginTOCContainer {...props}>
|
||||||
{children}
|
{children}
|
||||||
<div className="toc-ads-container">
|
{isClient && (
|
||||||
<div className="wwads-cn wwads-vertical toc-ads" data-id="281"></div>
|
<div className="toc-ads-container">
|
||||||
</div>
|
<div className="wwads-cn wwads-vertical toc-ads" data-id="281"></div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</OriginTOCContainer>
|
</OriginTOCContainer>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user