Skip to content

Commit dc33ff4

Browse files
authored
[Frontend] 견적 짜기 화면 css (#112)
## 📝작업 내용 견적 짜기 화면 구현 장바구니 쪽은 css만 ## 💬리뷰 요구사항(선택) 모달 로직 좀 확인해주세요 !
1 parent 838dca4 commit dc33ff4

Some content is hidden

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

42 files changed

+1359
-14
lines changed
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import styles from './categoryItem.module.css'
2+
3+
interface categoryItemProps{
4+
category: string;
5+
active: boolean;
6+
onClick: () => void;
7+
}
8+
export default function CategoryItem({category, active, onClick}: categoryItemProps){
9+
return(
10+
<div className={`${styles.item} ${active ? styles.active : ''}`} onClick={onClick}>{category}</div>
11+
)
12+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import CategoryItem from "./CategoryItem";
2+
import styles from './categorySelector.module.css'
3+
import productData from '@/dummy/dummy_compabilityCheck.json'
4+
import { usePartListStore } from "@/stores/usePartListStore";
5+
6+
export default function CategorySelector(){
7+
const {currentCategory, setCurrentCategory, setCurrentPage, setSearchResult, setInputValue} = usePartListStore();
8+
return(
9+
<div className={styles.container}>
10+
<div className={styles.content}>
11+
{productData.map((item: any) => {
12+
return(
13+
<CategoryItem
14+
key={item.id}
15+
category={item.name}
16+
active={currentCategory===item.name}
17+
onClick={()=>{
18+
setCurrentCategory(item.name);
19+
setCurrentPage(1);
20+
setSearchResult([]);
21+
setInputValue("");
22+
}}
23+
/>
24+
)
25+
})}
26+
</div>
27+
<div className={styles.line}></div>
28+
</div>
29+
)
30+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.item{
2+
width: fit-content;
3+
height: fit-content;
4+
padding: var(--spacing-1) var(--spacing-4);
5+
line-height: 150%;
6+
color: var(--color-gray-600);
7+
font-weight: var(--font-weight-medium);
8+
border-radius: var(--border-radius-2xl);
9+
cursor: pointer;
10+
}
11+
12+
.active{
13+
border: solid 1px #ff5525;
14+
color: #ff5525;
15+
font-weight: var(--font-weight-bold);
16+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
.container{
2+
margin-top: var(--spacing-12);
3+
display: flex;
4+
flex-direction: column;
5+
align-items: center;
6+
}
7+
8+
.content{
9+
display: flex;
10+
gap: var(--spacing-6);
11+
margin-bottom: var(--spacing-2);
12+
}
13+
14+
.line{
15+
width: 1050px;
16+
height: var(--border-width-1);
17+
background-color: var(--color-gray-300);
18+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import style from "./estimateButton.module.css";
2+
3+
interface estimateBtnProp {
4+
content: string;
5+
onClick?: () => void;
6+
variant?: "primary" | "outline";
7+
size?: "sm" | "md" | "lg" ;
8+
}
9+
10+
export default function EstimateButton({
11+
content,
12+
onClick,
13+
variant = "primary",
14+
size = "md",
15+
}: estimateBtnProp) {
16+
17+
const buttonClass = [
18+
style.btn,
19+
style[variant],
20+
style[size],
21+
]
22+
.filter(Boolean)
23+
.join(" ");
24+
25+
return (
26+
<button
27+
className={buttonClass}
28+
onClick={onClick}
29+
>
30+
{content}
31+
</button>
32+
);
33+
}

0 commit comments

Comments
 (0)