mirror of
https://github.com/koreanbots/core.git
synced 2025-12-15 14:10:22 +00:00
chore: change ad code
This commit is contained in:
parent
b8218c0db1
commit
f711a9dc4e
@ -2,8 +2,10 @@ import { useEffect } from 'react'
|
||||
|
||||
const Advertisement = ({ size='short' }:AdvertisementProps): JSX.Element => {
|
||||
useEffect(() => {
|
||||
if(process.env.NODE_ENV === 'production')
|
||||
window?.adsbygoogle?.push({})
|
||||
if(process.env.NODE_ENV === 'production') {
|
||||
window.adsbygoogle = window.adsbygoogle || []
|
||||
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={size === 'short' ? { height: '90px' } : { height: '330px'}}>
|
||||
@ -21,7 +23,7 @@ const Advertisement = ({ size='short' }:AdvertisementProps): JSX.Element => {
|
||||
|
||||
declare global {
|
||||
interface Window { adsbygoogle: {
|
||||
loaded: boolean
|
||||
loaded?: boolean
|
||||
push(obj: unknown): void
|
||||
} }
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user