Skip to content

Commit 5138b94

Browse files
committed
feat: 어조 선택 페이지 UI 제작
1 parent 7b9b852 commit 5138b94

File tree

9 files changed

+172
-1
lines changed

9 files changed

+172
-1
lines changed
289 KB
Loading
246 KB
Loading
341 KB
Loading

src/assets/svg/ic-empty-circle.svg

Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
.SelectStyle {
2+
padding-left: 1.25rem;
3+
padding-right: 1.25rem;
4+
padding-bottom: 2.5rem;
5+
height: calc(100vh - 2.75rem);
6+
display: flex;
7+
flex-direction: column;
8+
justify-content: space-between;
9+
background: var(--color-bg-gradient);
10+
11+
&::before {
12+
content: "";
13+
background: url("/src/assets/svg/img-graphic-main.svg") center no-repeat;
14+
background-size: 100% 16.375rem;
15+
filter: blur(4.625rem);
16+
position: absolute;
17+
top: 0;
18+
left: 0;
19+
right: 0;
20+
bottom: 0;
21+
z-index: 0;
22+
}
23+
}
24+
25+
.Title {
26+
z-index: 1;
27+
margin-top: 2.5rem;
28+
29+
& > h2 {
30+
margin-top: 0.625rem;
31+
}
32+
}
33+
34+
.Image {
35+
display: flex;
36+
justify-content: center;
37+
align-items: center;
38+
z-index: 1;
39+
40+
& > img {
41+
width: 13.125rem;
42+
height: 13.125rem;
43+
}
44+
}
45+
46+
.StyleButtonList {
47+
display: flex;
48+
flex-direction: column;
49+
gap: 0.875rem;
50+
z-index: 1;
51+
52+
& > div {
53+
height: 3rem;
54+
padding: 0.75rem 0.875rem;
55+
border-radius: 0.875rem;
56+
background-color: var(--color-white);
57+
display: flex;
58+
align-items: center;
59+
justify-content: space-between;
60+
61+
&.isSelected {
62+
background-color: var(--color-text-primary);
63+
}
64+
}
65+
}
66+
67+
.Bottom {
68+
display: flex;
69+
align-items: center;
70+
gap: 0.875rem;
71+
z-index: 1;
72+
}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
import { useState } from "react";
2+
3+
import classNames from "classnames";
4+
5+
import styles from "@/components/SelectStyle/SelectStyle.module.scss";
6+
import Button from "@/components/ui/Button/Button";
7+
import Icon from "@/components/ui/Icon/Icon";
8+
import Text from "@/components/ui/Text/Text";
9+
10+
interface StyleProps {
11+
name: string;
12+
image: string;
13+
}
14+
15+
const IMG_STYLE_DATA = [
16+
{ name: "default", image: "/assets/img/img-graphic-logo.png" },
17+
{ name: "친절한 미식가", image: "/assets/img/img-style-friendly.png" },
18+
{ name: "믿음직한 미식가", image: "/assets/img/img-style-trust.png" },
19+
{ name: "귀여운 미식가", image: "/assets/img/img-style-cute.png" },
20+
];
21+
22+
const SelectStyle = () => {
23+
const [selectedStyle, setSelectedStyle] = useState(IMG_STYLE_DATA[0]);
24+
25+
const handleStyleClick = (style: StyleProps) => {
26+
setSelectedStyle((prevStyle) => (prevStyle.name === style.name ? IMG_STYLE_DATA[0] : style));
27+
};
28+
29+
return (
30+
<div className={styles.SelectStyle}>
31+
<div className={styles.Title}>
32+
<Text variant="titleM" color="primary" align="center" as="h1">
33+
나는 어떤 미식가인가요?
34+
</Text>
35+
<Text variant="bodyLg" color="secondary" align="center" as="h2">
36+
선택지에 따라 리뷰 어조가 달라져요
37+
</Text>
38+
</div>
39+
40+
<div className={styles.Image}>
41+
<img src={selectedStyle.image} alt={`${selectedStyle.name}-img`} />
42+
</div>
43+
44+
<div className={styles.StyleButtonList}>
45+
{IMG_STYLE_DATA.slice(1, 4).map((style) => (
46+
<div
47+
key={style.name}
48+
className={classNames({
49+
[styles.isSelected]: selectedStyle.name === style.name,
50+
})}
51+
onClick={() => handleStyleClick(style)}
52+
>
53+
<Text color={selectedStyle.name === style.name ? "white" : "secondary"} variant="bodyM">
54+
{style.name}
55+
</Text>
56+
<Icon name={selectedStyle.name === style.name ? "checkCircle" : "emptyCircle"} />
57+
</div>
58+
))}
59+
</div>
60+
61+
<div className={styles.Bottom}>
62+
<Button text="리뷰 만들기" />
63+
</div>
64+
</div>
65+
);
66+
};
67+
68+
export default SelectStyle;

src/components/ui/Icon/Icon.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
11
import CameraIcon from "@/assets/svg/ic-camera.svg?react";
2+
import CheckCircleIcon from "@/assets/svg/ic-check-circle.svg?react";
23
import CloseIcon from "@/assets/svg/ic-close.svg?react";
4+
import EmptyCircleIcon from "@/assets/svg/ic-empty-circle.svg?react";
35
import GalleryIcon from "@/assets/svg/ic-gallery.svg?react";
46
import LeftArrowIcon from "@/assets/svg/ic-left-arrow.svg?react";
57
import PasteIcon from "@/assets/svg/ic-paste.svg?react";
68
import PlusIcon from "@/assets/svg/ic-plus.svg?react";
79

8-
export type IconNameType = "camera" | "close" | "gallery" | "leftArrow" | "paste" | "plus";
10+
export type IconNameType =
11+
| "camera"
12+
| "close"
13+
| "gallery"
14+
| "leftArrow"
15+
| "paste"
16+
| "plus"
17+
| "checkCircle"
18+
| "emptyCircle";
919

1020
export interface IconProps {
1121
name: IconNameType;
@@ -18,6 +28,8 @@ export const ICONS = {
1828
leftArrow: LeftArrowIcon,
1929
paste: PasteIcon,
2030
plus: PlusIcon,
31+
checkCircle: CheckCircleIcon,
32+
emptyCircle: EmptyCircleIcon,
2133
};
2234

2335
// 추후 사이즈, 컬러등 추가 가능

src/pages/SelectStylePage.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import Navbar from "@/components/common/Navbar";
2+
import SelectStyle from "@/components/SelectStyle/SelectStyle";
3+
4+
const SelectStylePage = () => {
5+
return (
6+
<>
7+
<Navbar />
8+
<SelectStyle />
9+
</>
10+
);
11+
};
12+
13+
export default SelectStylePage;

src/router/AppRouter.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import App from "@/App";
55
import HomePage from "@/pages/HomePage";
66
import ReceiptEditPage from "@/pages/ReceiptEditPage";
77
import RecognitionFailPage from "@/pages/RecognitionFailPage";
8+
import SelectStylePage from "@/pages/SelectStylePage";
89
import SelectTagPage from "@/pages/SelectTagPage";
910

1011
const AppRouter = () => {
@@ -29,6 +30,10 @@ const AppRouter = () => {
2930
path: "/select-tag",
3031
element: <SelectTagPage />,
3132
},
33+
{
34+
path: "/select-style",
35+
element: <SelectStylePage />,
36+
},
3237
],
3338
},
3439
]);

0 commit comments

Comments
 (0)