Skip to content

Commit e8c3388

Browse files
committed
refactor: remove mobile anchor ads implementation
1 parent 23820b2 commit e8c3388

File tree

1 file changed

+1
-23
lines changed

1 file changed

+1
-23
lines changed

docs/src/theme/Footer/index.js

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,9 @@
11
/* eslint-disable import/no-unresolved */
2-
import React, { useEffect } from 'react'
2+
import React from 'react'
33
import Footer from '@theme-original/Footer'
44
// import AdsContainerElement from '@site/src/components/AdsContainerElement'
55

66
export default function FooterWrapper(props) {
7-
useEffect(() => {
8-
if (typeof window !== 'undefined') {
9-
const scriptElement = document.createElement('script')
10-
scriptElement.src =
11-
'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-7420210265158247'
12-
scriptElement.async = true
13-
scriptElement.onload = () => {
14-
if (typeof window !== 'undefined') {
15-
window.onload = () => {
16-
if (window.document.body.clientWidth <= 768) {
17-
;(window.adsbygoogle = window.adsbygoogle || []).push({
18-
google_ad_client: 'ca-pub-7420210265158247',
19-
enable_page_level_ads: true,
20-
overlays: { bottom: true },
21-
})
22-
}
23-
}
24-
}
25-
}
26-
}
27-
}, [])
28-
297
return (
308
<>
319
<Footer {...props} />

0 commit comments

Comments
 (0)