Skip to content

Commit 8caddca

Browse files
committed
fix: update footer component to fix build
1 parent 03637d2 commit 8caddca

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

docs/src/theme/Footer/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ import Footer from '@theme-original/Footer'
44
// import AdsContainerElement from '@site/src/components/AdsContainerElement'
55

66
export default function FooterWrapper(props) {
7+
let shadoWindow = null
8+
79
useEffect(() => {
810
if (typeof window !== 'undefined') {
11+
shadoWindow = window
912
const scriptElement = document.createElement('script')
1013
scriptElement.src =
1114
'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-7420210265158247'
@@ -23,7 +26,7 @@ export default function FooterWrapper(props) {
2326

2427
return (
2528
<>
26-
{window && window.document.body.clientWidth <= 768 && (
29+
{shadoWindow && shadoWindow.document.body.clientWidth <= 768 && (
2730
<ins
2831
className="adsbygoogle"
2932
style={{

0 commit comments

Comments
 (0)