mirror of
https://github.com/koreanbots/core.git
synced 2025-12-15 14:10:22 +00:00
tests: ad
This commit is contained in:
parent
39d915c0ea
commit
d7633fde99
@ -1,5 +1,11 @@
|
|||||||
const Advertisement = (): JSX.Element => {
|
import { useEffect } from 'react'
|
||||||
|
|
||||||
|
const Advertisement = (): JSX.Element => {
|
||||||
|
useEffect(() => {
|
||||||
|
if(process.env.NODE_ENV === 'production')
|
||||||
|
window?.adsbygoogle?.push({})
|
||||||
|
})
|
||||||
|
|
||||||
return <div className={`z-0 mx-auto w-full text-center text-white ${process.env.NODE_ENV === 'production' ? '' : 'py-12 bg-gray-700'}`} style={{ height: '90px' }}>
|
return <div className={`z-0 mx-auto w-full text-center text-white ${process.env.NODE_ENV === 'production' ? '' : 'py-12 bg-gray-700'}`} style={{ height: '90px' }}>
|
||||||
{
|
{
|
||||||
process.env.NODE_ENV === 'production' ? <ins
|
process.env.NODE_ENV === 'production' ? <ins
|
||||||
@ -13,4 +19,11 @@ const Advertisement = (): JSX.Element => {
|
|||||||
}</div>
|
}</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface Window { adsbygoogle: {
|
||||||
|
loaded: boolean
|
||||||
|
push(obj: unknown): void
|
||||||
|
} }
|
||||||
|
}
|
||||||
|
|
||||||
export default Advertisement
|
export default Advertisement
|
||||||
|
|||||||
@ -22,7 +22,6 @@ class MyDocument extends Document {
|
|||||||
<script
|
<script
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
__html: `
|
__html: `
|
||||||
setTimeout(() => document.querySelectorAll('ins.adsbygoogle').forEach(() => (adsbygoogle = window.adsbygoogle || []).push({})), 1000)
|
|
||||||
window.dataLayer = window.dataLayer || [];
|
window.dataLayer = window.dataLayer || [];
|
||||||
function gtag(){dataLayer.push(arguments);}
|
function gtag(){dataLayer.push(arguments);}
|
||||||
gtag('js', new Date());
|
gtag('js', new Date());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user