-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/issue 65 feat 기술스택 팝오버 구현 #79
The head ref may contain hidden characters: "feature/issue-65--Feat-\uAE30\uC220\uC2A4\uD0DD-\uD31D\uC624\uBC84-\uAD6C\uD604"
Changes from all commits
8069bcc
a8af40f
566fb8e
be251ef
565b6d2
ceb43ba
3aa6747
cc564f0
b30ae13
39973bc
d7d7f97
f05123b
9de5f8e
7cc2a0d
aa7961a
090b219
abfb205
b08202e
46ef5b3
3bd9b26
d74ef55
f2455aa
4e63810
10623c0
0ca2ae3
038323e
7fd7772
2db8d1c
79ff50e
cb538da
3d7aa9d
28db387
8092716
844edf9
43fed1e
7d944b7
3843afd
4ee4442
8241597
9287a96
7439bf8
f8de1a8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,15 +4,18 @@ import { MouseEvent } from "react"; | |
import { ICONS } from "@/constants/icons"; | ||
|
||
interface DeleteStackChipProps { | ||
label: string; | ||
onClick: (e: MouseEvent<HTMLDivElement>) => void; | ||
label: string; | ||
onDelete: (stack: string) => void; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. onClick이 onDelete로 조금 더 명확한 이름으로 바뀌었습니다 |
||
} | ||
|
||
export default function DeleteStackChip({ label, onClick }: DeleteStackChipProps | ||
) { | ||
return <Container label={label} icon={ICONS.deleted} onClick={onClick} />; | ||
export default function DeleteStackChip({ label, onDelete }: DeleteStackChipProps) { | ||
const onClick = (e: MouseEvent<HTMLDivElement>) => { | ||
onDelete(label); | ||
}; | ||
|
||
return <Container label={label} icon={ICONS.deleted} onIconClick={onClick} />; | ||
} | ||
|
||
const Container = styled(DefaultChip)` | ||
padding: 0.4rem .8rem .4rem 1.2rem; | ||
` | ||
padding: 0.4rem 0.8rem 0.4rem 1.2rem; | ||
`; |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 전반적인 CSS 수정이 있었습니다. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,12 +11,12 @@ interface FilterButtonProps { | |
|
||
const { popover, popoverSelected } = ICONS; | ||
|
||
export default function FilterDropButton({ selectOption, onClick, isSelected }: FilterButtonProps) { | ||
export default function FilterButton({ selectOption, onClick, isSelected }: FilterButtonProps) { | ||
return ( | ||
<Container $isSelected={isSelected} onClick={onClick}> | ||
{selectOption} | ||
{isSelected ? ( | ||
<Arrow src={popoverSelected.src} alt={popoverSelected.alt} /> | ||
<Arrow $isSelected src={popoverSelected.src} alt={popoverSelected.alt} /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. toggle Open 상태일 때 화살표 반대로 되도록 해놨습니다 |
||
) : ( | ||
<Arrow src={popover.src} alt={popover.alt} /> | ||
)} | ||
|
@@ -48,7 +48,15 @@ const Container = styled.button<Container>` | |
${typography.font12Semibold} | ||
`; | ||
|
||
const Arrow = styled.img` | ||
interface Arrow { | ||
$isSelected?: boolean; | ||
} | ||
|
||
const Arrow = styled.img<Arrow>` | ||
width: 1.2rem; | ||
height: 1.2rem; | ||
|
||
${({ $isSelected }) => | ||
$isSelected && `transform: rotate(180deg);` | ||
} | ||
`; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import DESIGN_TOKEN from "@/styles/tokens"; | ||
import { MouseEvent } from "react"; | ||
import styled from "styled-components"; | ||
|
||
interface FilterListProps { | ||
currentFilter: string | ||
filters: string[]; | ||
onFilterClick(filter: string): void; | ||
className?: string; | ||
} | ||
|
||
export default function FilterList({ currentFilter, filters, onFilterClick, className }: FilterListProps) { | ||
|
||
const handleFilterClick = (e: MouseEvent<HTMLDivElement>) => { | ||
const filter = e.currentTarget.textContent; | ||
if (filter) { | ||
onFilterClick(filter); | ||
} | ||
}; | ||
|
||
return ( | ||
<Container className={className}> | ||
{filters.map((filter) => ( | ||
<Box key={filter} $isSelected={currentFilter === filter} onClick={handleFilterClick}> | ||
{filter} | ||
</Box> | ||
))} | ||
</Container> | ||
); | ||
} | ||
|
||
const { color, typography, mediaQueries } = DESIGN_TOKEN; | ||
|
||
const Container = styled.div` | ||
display: flex; | ||
gap: 2rem; | ||
|
||
color: ${color.gray[1]}; | ||
|
||
${typography.font16Bold} | ||
|
||
${mediaQueries.mobile} { | ||
gap: 1.6rem; | ||
|
||
${typography.font14Bold} | ||
} | ||
`; | ||
|
||
interface BoxProps { | ||
$isSelected?: boolean; | ||
} | ||
|
||
const Box = styled.div<BoxProps>` | ||
${({ $isSelected }) => $isSelected && `color: ${color.black[1]};`} | ||
|
||
&:hover { | ||
cursor: pointer; | ||
${({ $isSelected }) => !$isSelected && `color: ${color.black[3]};`} | ||
} | ||
`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
툴팁 표시를 위해서
title={label}
이 추가되었습니다외에는 안보셔도 됩니다