File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change 1
1
/* eslint-disable import/no-unresolved */
2
- import React from 'react'
2
+ import React , { useEffect } from 'react'
3
3
import Footer from '@theme-original/Footer'
4
4
// import AdsContainerElement from '@site/src/components/AdsContainerElement'
5
5
6
6
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
+ ; ( window . adsbygoogle = window . adsbygoogle || [ ] ) . push ( { } )
17
+ }
18
+ }
19
+ }
20
+ document . body . appendChild ( scriptElement )
21
+ }
22
+ } , [ ] )
23
+
7
24
return (
8
25
< >
9
26
< Footer { ...props } />
You can’t perform that action at this time.
0 commit comments