Skip to content

Commit b2de49d

Browse files
authored
Merge pull request #52 from SOPT-all/feat/work-keywords/#45
[feat/#45] 작품 키워드 칩 컴포넌트 구현
2 parents d9e78b7 + d9ea7b2 commit b2de49d

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import { style } from "@vanilla-extract/css";
2+
import { components } from "@/shared/styles/layer.css";
3+
4+
import { color } from "@/shared/styles/tokens/color.css";
5+
import { typographyVars } from "@/shared/styles/typography.css";
6+
7+
// 레이아웃
8+
export const keywordsRoot = style({
9+
"@layer": {
10+
[components]: {
11+
display: "flex",
12+
flexWrap: "wrap",
13+
gap: "0.8rem",
14+
},
15+
},
16+
});
17+
18+
// 칩 하나
19+
export const keywordsChip = style({
20+
"@layer": {
21+
[components]: {
22+
...typographyVars.body3,
23+
display: "inline-flex",
24+
alignItems: "center",
25+
justifyContent: "center",
26+
height: "3.6rem",
27+
padding: "0.8rem 1.2rem",
28+
borderRadius: "1.8rem",
29+
border: `0.1rem solid ${color.gray[200]}`,
30+
backgroundColor: color.white[100],
31+
color: color.gray[100],
32+
33+
boxSizing: "border-box",
34+
userSelect: "none",
35+
},
36+
},
37+
});
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import type { JSX } from "react";
2+
import * as styles from "./work-keywords.css";
3+
4+
export interface WorkKeyword {
5+
id: string;
6+
label: string;
7+
}
8+
9+
export interface WorkKeywordsProps {
10+
keywords: WorkKeyword[];
11+
}
12+
export function WorkKeywords({ keywords }: WorkKeywordsProps): JSX.Element {
13+
return (
14+
<ul className={styles.keywordsRoot}>
15+
{keywords.map(({ id, label }) => (
16+
<li key={id} className={styles.keywordsChip} title={label}>
17+
{label}
18+
</li>
19+
))}
20+
</ul>
21+
);
22+
}

0 commit comments

Comments
 (0)