@@ -3,15 +3,19 @@ import { BottomNav, ControlBar } from '@/shared/components';
33import Image from 'next/image' ;
44import { useRouter } from 'next/router' ;
55import StampBoard from '@/shared/components/main/components/stampBoard/StampBoard' ;
6+ import { useGetStampStatus } from '@/shared/main/queries/useGetStampStatus' ;
67
78export default function MainPage ( ) {
89 const router = useRouter ( ) ;
10+
11+ const { data, isLoading, isError } = useGetStampStatus ( ) ;
12+
913 return (
1014 < div
1115 className = { cn (
1216 'px-[2.4rem] bg-white flex flex-col gap-[1rem] h-full pt-[1.3rem] pb-[12rem]' ,
1317 ) }
14- >
18+ >
1519 < ControlBar
1620 isLoggedIn = { false }
1721 onLogin = { ( ) => { } }
@@ -23,18 +27,18 @@ export default function MainPage() {
2327 < section >
2428 < Image
2529 src = '/assets/bannerMain.svg'
26- alt = ""
27- aria-hidden = " true"
30+ alt = ''
31+ aria-hidden = ' true'
2832 width = { 354 }
2933 height = { 79 }
3034 className = 'w-full h-auto object-cover block'
3135 />
3236 </ section >
3337
3438 < section
35- role = " button"
39+ role = ' button'
3640 tabIndex = { 0 }
37- aria-label = " 보드판으로 이동"
41+ aria-label = ' 보드판으로 이동'
3842 onClick = { ( ) => {
3943 router . push ( '/main/Board' ) ;
4044 } }
@@ -44,12 +48,24 @@ export default function MainPage() {
4448 alt = '보드판'
4549 width = { 354 }
4650 height = { 426.36 }
47- className = 'w-full h-auto object-cover block'
51+ className = 'w-full h-auto object-cover block cursor-pointer transition-transform hover:scale-[1.01] '
4852 />
4953 </ section >
5054
51- < StampBoard count = { 3 } total = { 10 } />
55+ { isLoading ? (
56+ < p className = 'text-gray-400 text-center py-4' > 불러오는 중...</ p >
57+ ) : isError ? (
58+ < p className = 'text-red-400 text-center py-4' >
59+ 데이터를 불러오지 못했습니다 😢
60+ </ p >
61+ ) : (
62+ < StampBoard
63+ count = { data ?. collectedStampCount ?? 0 }
64+ total = { data ?. totalStampCount ?? 10 }
65+ />
66+ ) }
5267 </ main >
68+
5369 < BottomNav />
5470 </ div >
5571 ) ;
0 commit comments