Skip to content

Commit 6ed19de

Browse files
authored
Merge pull request #60 from Leets-Official/58-feat/메인페이지-케로셀-제작
[Feat] 메인페이지 케로셀 제작
2 parents 00338d0 + b75cb48 commit 6ed19de

64 files changed

Lines changed: 696 additions & 295 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"react-dom": "^19.2.3",
3535
"react-hook-form": "^7.71.1",
3636
"react-router": "7.12.0",
37+
"swiper": "^12.0.3",
3738
"tailwind-merge": "^3.4.0",
3839
"tailwind-variants": "^3.2.2",
3940
"zod": "^4.2.1",

src/app/routes/(main)/_index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import MainPage from '@pages/main';
1+
import { MainPage } from '@pages/main';
22

33
export default MainPage;

src/pages/login/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export { default as LoginPage } from './ui/LoginPage';
1+
export { LoginPage } from './ui';

src/pages/login/ui/LoginPage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import loginBg from '@shared/assets/background/login_background.png';
1+
import { loginBackgroundImg } from '@shared/assets/background';
22
import { kakaoLoginImg } from '@shared/assets/icons';
33
import { Logo } from '@shared/ui/Logo';
44
import { loginStyles as s } from './LoginPage.styles';
55

66
export default function LoginPage() {
77
return (
8-
<div className={s.wrapper} style={{ backgroundImage: `url(${loginBg})` }}>
8+
<div className={s.wrapper} style={{ backgroundImage: `url(${loginBackgroundImg})` }}>
99
<div className="flex h-full w-full flex-col items-center justify-center gap-[26px] px-6 py-12">
1010
<Logo className="h-[36px] w-[192px] cursor-pointer" />
1111

src/pages/login/ui/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as LoginPage } from './LoginPage';

src/pages/main/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export { default } from './ui/MainPage';
1+
export { MainPage } from './ui';

src/pages/main/ui/BannerCards.tsx

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import { GearIcon, SellIcon, ShoppingIcon } from '@shared/assets/icons';
2+
import { ROUTES } from '@shared/constants';
3+
4+
export const BANNER_CARDS = [
5+
{
6+
id: 'buy',
7+
title: (
8+
<>
9+
중고 전자기기
10+
<br />
11+
구매하기
12+
</>
13+
),
14+
description: '합리적인 매물을 찾아보세요.',
15+
imageSrc: ShoppingIcon,
16+
route: ROUTES.BUY,
17+
},
18+
{
19+
id: 'sell',
20+
title: (
21+
<>
22+
중고 전자기기
23+
<br />
24+
판매하기
25+
</>
26+
),
27+
description: '사용하지 않는 기기를 판매해보세요.',
28+
imageSrc: SellIcon,
29+
route: ROUTES.SELL,
30+
},
31+
{
32+
id: 'repair',
33+
title: (
34+
<>
35+
근처
36+
<br />
37+
수리점 찾기
38+
</>
39+
),
40+
description: '가까운 수리점을 찾아드려요.',
41+
imageSrc: GearIcon,
42+
route: ROUTES.REPAIR,
43+
},
44+
];
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import {
2+
PhoneRecycleImage,
3+
PhoneRepairImage,
4+
PhoneSellImage,
5+
SloganImage,
6+
SmartphoneImage,
7+
} from '@shared/assets/images';
8+
import { CarouselImageSlide } from '@shared/ui/Carousel3D';
9+
10+
export const CAROUSEL_SLIDES = [
11+
{
12+
id: 1,
13+
content: (
14+
<CarouselImageSlide imageSrc={SloganImage} title="버리기 전, 루핏" subtitle="Before you throw out, LOOPIT" />
15+
),
16+
},
17+
{
18+
id: 2,
19+
content: (
20+
<CarouselImageSlide imageSrc={SmartphoneImage} title="중고폰 구매" subtitle="검증된 중고폰을 합리적인 가격에" />
21+
),
22+
},
23+
{
24+
id: 3,
25+
content: (
26+
<CarouselImageSlide imageSrc={PhoneSellImage} title="내 폰 판매" subtitle="안 쓰는 폰, 현금으로 바꾸세요" />
27+
),
28+
},
29+
{
30+
id: 4,
31+
content: (
32+
<CarouselImageSlide imageSrc={PhoneRepairImage} title="수리점 찾기" subtitle="가까운 수리점을 찾아드려요" />
33+
),
34+
},
35+
{
36+
id: 5,
37+
content: <CarouselImageSlide imageSrc={PhoneRecycleImage} title="친환경 순환" subtitle="버려지는 폰에 새 생명을" />,
38+
},
39+
];

src/pages/main/ui/MainPage.tsx

Lines changed: 20 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,35 @@
1-
import { GearIcon, SellIcon, ShoppingIcon } from '@shared/assets/icons';
21
import { ROUTES } from '@shared/constants';
32
import { BannerCard } from '@shared/ui/BannerCard';
3+
import { Carousel3D } from '@shared/ui/Carousel3D';
44
import { ChatbotFloatingButton } from '@shared/ui/ChatbotFloatingButton';
5+
import { ClientOnly } from '@shared/ui/ClientOnly';
56
import { useNavigate } from 'react-router';
7+
import { BANNER_CARDS } from './BannerCards';
8+
import { CAROUSEL_SLIDES } from './CarouselSlides';
69

710
export default function MainPage() {
811
const navigate = useNavigate();
912

1013
return (
1114
<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>
1320

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+
))}
5131
</section>
32+
5233
<ChatbotFloatingButton
5334
className="fixed right-4 bottom-4"
5435
onClick={() => navigate(ROUTES.CHATBOT, { viewTransition: true })}

src/pages/main/ui/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as MainPage } from './MainPage';

0 commit comments

Comments
 (0)