Skip to content

Commit

Permalink
[fix] 배포환경에서 터지는 문제 해결..! #458
Browse files Browse the repository at this point in the history
  • Loading branch information
triplecheeseburger committed Aug 10, 2023
1 parent 22886a9 commit f76dd55
Showing 1 changed file with 22 additions and 18 deletions.
40 changes: 22 additions & 18 deletions components/global/GoogleAd.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,30 @@ export default function GoogleAd({
layoutKey?: string;
}) {
useEffect(() => {
if (process.env.NODE_ENV !== 'production') return;
((window as any).adsbygoogle = (window as any).adsbygoogle || []).push({});
// if (process.env.NODE_ENV !== 'production') return;
window.onload = () => {
((window as any).adsbygoogle = (window as any).adsbygoogle || []).push(
{}
);
};
}, []);

if (process.env.NODE_ENV !== 'production')
return (
<div
style={{
background: '#e9e9e9',
color: 'black',
fontSize: '18px',
fontWeight: 'bold',
textAlign: 'center',
padding: '16px',
margin: '0',
}}
>
광고 표시 영역
</div>
);
// if (process.env.NODE_ENV !== 'production')
// return (
// <div
// style={{
// background: '#e9e9e9',
// color: 'black',
// fontSize: '18px',
// fontWeight: 'bold',
// textAlign: 'center',
// padding: '16px',
// margin: '0',
// }}
// >
// 광고 표시 영역
// </div>
// );

return (
<div>
Expand Down

0 comments on commit f76dd55

Please sign in to comment.