refactor menu to use dropdown component
This commit is contained in:
parent
096d4c2651
commit
9d943c1182
4 changed files with 25 additions and 79 deletions
|
@ -21,8 +21,6 @@ export function Dropdown(props: DropdownProps) {
|
|||
const [dialog, setDialog] = createSignal<HTMLDialogElement>();
|
||||
const [open, setOpen] = createSignal<boolean>(props.open ?? false);
|
||||
|
||||
const showCaret = createMemo(() => props.showCaret ?? true);
|
||||
|
||||
createEffect(() => {
|
||||
dialog()?.[open() ? 'showPopover' : 'hidePopover']();
|
||||
});
|
||||
|
@ -42,7 +40,7 @@ export function Dropdown(props: DropdownProps) {
|
|||
<button id={`${props.id}_button`} popoverTarget={`${props.id}_dialog`} class={css.button}>
|
||||
{props.text}
|
||||
|
||||
<Show when={showCaret()}>
|
||||
<Show when={props.showCaret}>
|
||||
<FaSolidAngleDown class={css.caret} />
|
||||
</Show>
|
||||
</button>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue