Skip to content

Commit

Permalink
Close price filter dropdown when it is applied
Browse files Browse the repository at this point in the history
refs #49
  • Loading branch information
franthormel committed Aug 15, 2024
1 parent 9387322 commit 1fca49a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion components/dropdown/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,23 @@ import ButtonTextIconOutlined from "../buttons/text-icon-outlined";

export interface DropdownProps {
text: string,
display?: boolean,
onClick?: () => void
}

export default function Dropdown({ children, props }: { children: ReactNode, props: DropdownProps }) {
const [display, setDisplay] = useState<boolean>(false);
const [display, setDisplay] = useState<boolean>(props.display ?? false);

return (
<div className="relative flex">
<ButtonTextIconOutlined props={{
text: props.text,
onClick: (e) => {
if (props.onClick) {
props.onClick()
console.log("Clicked")
}

setDisplay(!display);
}
}}>
Expand Down

0 comments on commit 1fca49a

Please sign in to comment.