From 28baf8d20837e145ccaf78eea2d2fa286103f03c Mon Sep 17 00:00:00 2001 From: triplecheeseburger Date: Fri, 11 Aug 2023 14:41:42 +0900 Subject: [PATCH] =?UTF-8?q?[fix]=20=EC=95=84=EC=A7=81=20=EC=9D=98=EB=8F=84?= =?UTF-8?q?=EB=B3=B4=EB=8B=A4=20=EA=B4=91=EA=B3=A0=EA=B0=80=20=EC=A2=80=20?= =?UTF-8?q?=EC=9E=91=EA=B2=8C=20=EB=82=98=EC=98=A4=EA=B8=B4=20=ED=95=98?= =?UTF-8?q?=EC=A7=80=EB=A7=8C..=20=EC=9D=BC=EB=8B=A8=20=ED=87=B4=EA=B7=BC?= =?UTF-8?q?=20#458?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/global/GoogleAd.tsx | 59 +++++++++++++----------------- styles/global/GoogleAd.module.scss | 11 ++++++ 2 files changed, 36 insertions(+), 34 deletions(-) diff --git a/components/global/GoogleAd.tsx b/components/global/GoogleAd.tsx index e97efc96..581e9941 100644 --- a/components/global/GoogleAd.tsx +++ b/components/global/GoogleAd.tsx @@ -1,18 +1,18 @@ import React, { useEffect } from 'react'; +import styles from 'styles/global/GoogleAd.module.scss'; + export default function GoogleAd({ - className = 'adsbygoogle', client = '', slot = '', format = '', }: { - className?: string; client?: string; slot?: string; format?: string; }) { useEffect(() => { - // if (process.env.NODE_ENV !== 'production') return; + if (process.env.NODE_ENV !== 'production') return; window.onload = () => { ((window as any).adsbygoogle = (window as any).adsbygoogle || []).push( {} @@ -20,38 +20,29 @@ export default function GoogleAd({ }; }, []); - // if (process.env.NODE_ENV !== 'production') - // return ( - //
- // 광고 표시 영역 - //
- // ); - - const style = { - display: 'block', - width: format === 'horizontal' ? 'auto' : '160px', - height: format === 'horizontal' ? '100px' : 'auto', - }; + if (process.env.NODE_ENV !== 'production') + return ( +
+ 광고 표시 영역 +
+ ); return ( -
- -
+ ); } diff --git a/styles/global/GoogleAd.module.scss b/styles/global/GoogleAd.module.scss index e69de29b..5e8eb35b 100644 --- a/styles/global/GoogleAd.module.scss +++ b/styles/global/GoogleAd.module.scss @@ -0,0 +1,11 @@ +.horizontal { + display: block; + width: 100%; + height: 100px; +} + +.vertical { + display: block; + width: 160px; + height: 100%; +} \ No newline at end of file