mirror of
https://github.com/koreanbots/core.git
synced 2025-12-16 06:20:24 +00:00
fix: ad script
This commit is contained in:
parent
207d6ec785
commit
12ea06b57d
@ -1,9 +1,4 @@
|
|||||||
import { useEffect } from 'react'
|
|
||||||
|
|
||||||
const Advertisement = (): JSX.Element => {
|
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' }}>
|
||||||
{
|
{
|
||||||
@ -18,11 +13,4 @@ const Advertisement = (): JSX.Element => {
|
|||||||
}</div>
|
}</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
|
||||||
interface Window { adsbygoogle: {
|
|
||||||
loaded: boolean
|
|
||||||
push(obj: unknown): void
|
|
||||||
} }
|
|
||||||
}
|
|
||||||
|
|
||||||
export default Advertisement
|
export default Advertisement
|
||||||
|
|||||||
@ -22,6 +22,7 @@ class MyDocument extends Document {
|
|||||||
<script
|
<script
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
__html: `
|
__html: `
|
||||||
|
(adsbygoogle = window.adsbygoogle || []).push({})
|
||||||
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