diff --git a/src/App.tsx b/src/App.tsx index 273d864f..9657df29 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,7 +1,6 @@ import { QueryClient, QueryClientProvider, QueryErrorResetBoundary } from '@tanstack/react-query'; import { RouterProvider } from 'react-router-dom'; import router from './router/Router'; -import GlobalStyle from './style/GlobalStyle'; import Loading from './pages/Loading/Loading'; import { Suspense } from 'react'; import { ErrorBoundary } from 'react-error-boundary'; @@ -25,7 +24,6 @@ function App() { - { + const scriptElement = useRef(null); + + // script 태그를 동적으로 추가 + useEffect(() => { + const script = document.createElement('script'); + script.setAttribute('src', 'https://t1.daumcdn.net/kas/static/ba.min.js'); + script.setAttribute('charset', 'utf-8'); + + script.setAttribute('async', 'true'); + scriptElement.current?.appendChild(script); + }, []); + + return ( + <> + ... +
+ } + /> +
+ + ); +}; + +export default KakaoAd; diff --git a/src/components/KakaoAd/KakaoAdCallback.style.ts b/src/components/KakaoAd/KakaoAdCallback.style.ts new file mode 100644 index 00000000..79c7b0dd --- /dev/null +++ b/src/components/KakaoAd/KakaoAdCallback.style.ts @@ -0,0 +1,9 @@ +import styled from 'styled-components'; + +export const KakaoAdCallbackWrapper = styled.div` + ${({ theme }) => theme.mixin.flexCenter({})}; + background-color: white; + width: 100%; + color: black; + ${({ theme: { fonts } }) => fonts.body_03}; +`; diff --git a/src/components/KakaoAd/KakaoAdCallback.tsx b/src/components/KakaoAd/KakaoAdCallback.tsx new file mode 100644 index 00000000..105e9e30 --- /dev/null +++ b/src/components/KakaoAd/KakaoAdCallback.tsx @@ -0,0 +1,7 @@ +import * as S from './KakaoAdCallback.style'; + +const KakaoAdCallback = () => { + return 광고가 생성 될 부분입니다.; +}; + +export default KakaoAdCallback; diff --git a/src/pages/MyPage/MyPage.tsx b/src/pages/MyPage/MyPage.tsx index bf763178..2d4613f1 100644 --- a/src/pages/MyPage/MyPage.tsx +++ b/src/pages/MyPage/MyPage.tsx @@ -10,6 +10,7 @@ import { useNavigate } from 'react-router'; import { useState } from 'react'; import DeleteModal from '../../components/common/Modal/DeleteModal'; import { logOutInstance } from '../../apis/client'; +import KakaoAd from '../../components/KakaoAd/KakaoAd'; interface MyPage { memberData: MyPageType; } @@ -90,6 +91,7 @@ const MyPage = () => { {renderGiftRoom()} + );