diff --git a/src/app/template.tsx b/src/app/template.tsx index 062365f9..fd06b58c 100644 --- a/src/app/template.tsx +++ b/src/app/template.tsx @@ -9,6 +9,7 @@ import { CategoryBottomSheet } from './toks-main/components/CategoryBottomSheet' export default function Template({ children }: StrictPropsWithChildren) { // TODO: useAuth hook 구현 // TODO: useLogin Modal hook 구현 + // TODO: GlobalPortal 제거 const pathName = usePathname(); return ( diff --git a/src/app/toks-main/components/MainPageSlider/SkeletonSlider.tsx b/src/app/toks-main/components/MainPageSlider/SkeletonSlider.tsx index 57803fbb..86218151 100644 --- a/src/app/toks-main/components/MainPageSlider/SkeletonSlider.tsx +++ b/src/app/toks-main/components/MainPageSlider/SkeletonSlider.tsx @@ -1,3 +1,5 @@ export const SkeletonSlider = () => { - return
; + return ( + + ); }; diff --git a/src/app/toks-main/components/MainPageSlider/index.tsx b/src/app/toks-main/components/MainPageSlider/index.tsx index 2c1252af..a24f6008 100644 --- a/src/app/toks-main/components/MainPageSlider/index.tsx +++ b/src/app/toks-main/components/MainPageSlider/index.tsx @@ -1,13 +1,17 @@ -'use client'; -import { useSuspenseQuery } from '@tanstack/react-query'; +import { useQuery } from '@tanstack/react-query'; import { NoticeSlider } from '@/common'; +import { SkeletonSlider } from './SkeletonSlider'; import { QUERY_KEYS } from '../../constants/queryKeys'; import { getNotices } from '../../remotes/notice'; export const MainPageSlider = () => { - const { data: notices } = useSuspenseQuery({ + const { + data: notices, + isLoading, + isSuccess, + } = useQuery({ queryKey: [QUERY_KEYS.GET_NOTICES], queryFn: async () => { try { @@ -18,9 +22,16 @@ export const MainPageSlider = () => { }, }); - const imageInfo = notices.bottomBanners.map((el) => { - return { imageUrl: el.imageUrl, landingUrl: el.landingUrl }; - }); + if (isLoading) { + return