|
1 | | -import { GearIcon, SellIcon, ShoppingIcon } from '@shared/assets/icons'; |
2 | 1 | import { ROUTES } from '@shared/constants'; |
3 | 2 | import { BannerCard } from '@shared/ui/BannerCard'; |
| 3 | +import { Carousel3D } from '@shared/ui/Carousel3D'; |
4 | 4 | import { ChatbotFloatingButton } from '@shared/ui/ChatbotFloatingButton'; |
| 5 | +import { ClientOnly } from '@shared/ui/ClientOnly'; |
5 | 6 | import { useNavigate } from 'react-router'; |
| 7 | +import { BANNER_CARDS } from './BannerCards'; |
| 8 | +import { CAROUSEL_SLIDES } from './CarouselSlides'; |
6 | 9 |
|
7 | 10 | export default function MainPage() { |
8 | 11 | const navigate = useNavigate(); |
9 | 12 |
|
10 | 13 | return ( |
11 | 14 | <main className="flex w-full flex-col items-center gap-14 px-4 pt-8 pb-24"> |
12 | | - <section className="h-79.25 w-full max-w-300" aria-label="메인 슬로건 영역" /> |
| 15 | + <section className="h-79.25 w-full max-w-300" aria-label="메인 슬로건 영역"> |
| 16 | + <ClientOnly> |
| 17 | + <Carousel3D slides={CAROUSEL_SLIDES} /> |
| 18 | + </ClientOnly> |
| 19 | + </section> |
13 | 20 |
|
14 | | - <section className="grid w-full max-w-300 grid-cols-1 gap-6 xl:grid-cols-3"> |
15 | | - <BannerCard |
16 | | - title={ |
17 | | - <> |
18 | | - 중고 전자기기 |
19 | | - <br /> |
20 | | - 구매하기 |
21 | | - </> |
22 | | - } |
23 | | - description="합리적인 매물을 찾아보세요." |
24 | | - imageSrc={ShoppingIcon} |
25 | | - onClick={() => navigate(ROUTES.BUY, { viewTransition: true })} |
26 | | - /> |
27 | | - <BannerCard |
28 | | - title={ |
29 | | - <> |
30 | | - 중고 전자기기 |
31 | | - <br /> |
32 | | - 판매하기 |
33 | | - </> |
34 | | - } |
35 | | - description="사용하지 않는 기기를 판매해보세요." |
36 | | - imageSrc={SellIcon} |
37 | | - onClick={() => navigate(ROUTES.SELL, { viewTransition: true })} |
38 | | - /> |
39 | | - <BannerCard |
40 | | - title={ |
41 | | - <> |
42 | | - 근처 |
43 | | - <br /> |
44 | | - 수리점 찾기 |
45 | | - </> |
46 | | - } |
47 | | - description="가까운 수리점을 찾아드려요." |
48 | | - imageSrc={GearIcon} |
49 | | - onClick={() => navigate(ROUTES.REPAIR, { viewTransition: true })} |
50 | | - /> |
| 21 | + <section className="grid w-full max-w-300 grid-cols-1 gap-6 xl:grid-cols-3" aria-label="서비스 배너 영역"> |
| 22 | + {BANNER_CARDS.map((card) => ( |
| 23 | + <BannerCard |
| 24 | + key={card.id} |
| 25 | + title={card.title} |
| 26 | + description={card.description} |
| 27 | + imageSrc={card.imageSrc} |
| 28 | + onClick={() => navigate(card.route, { viewTransition: true })} |
| 29 | + /> |
| 30 | + ))} |
51 | 31 | </section> |
| 32 | + |
52 | 33 | <ChatbotFloatingButton |
53 | 34 | className="fixed right-4 bottom-4" |
54 | 35 | onClick={() => navigate(ROUTES.CHATBOT, { viewTransition: true })} |
|
0 commit comments