Skip to content

Commit

Permalink
#46 - feat: 드롭다운에 description 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
rhino-ty committed Apr 25, 2023
1 parent a11f82b commit ec32416
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/components/ui/dropDownUI.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,16 @@ interface DropDownProps {
list: string[];
selected: string;
onSelectedChange: (selected: string) => void;
description?: string;
}

export default function DropDown({ label, list, selected, onSelectedChange }: DropDownProps) {
export default function DropDown({
label,
list,
selected,
onSelectedChange,
description,
}: DropDownProps) {
const [isActive, setIsActive] = useState(false);

const onActiveToggle = useCallback(() => {
Expand Down Expand Up @@ -53,6 +60,7 @@ export default function DropDown({ label, list, selected, onSelectedChange }: Dr
))}
</S.DropdownMenuContainer>
</S.DropdownContainer>
{description && <S.Description>{description}</S.Description>}
</S.Container>
);
}
Expand Down Expand Up @@ -121,4 +129,14 @@ const S = {
background-color: ${theme.color.gray200};
`}
`,
Description: styled.div`
height: 17px;
font-size: 12px;
color: ${({ theme }) => theme.color.gray900};
flex: none;
order: 2;
align-self: stretch;
flex-grow: 0;
margin: 8px 0px;
`,
};

0 comments on commit ec32416

Please sign in to comment.