convert ScreenDropdown to use ActionMenu

This commit is contained in:
Keviin Åberg Kultalahti 2021-04-26 13:44:26 +02:00
parent 21ee564f5b
commit 7f70fa3c0b
1 changed files with 11 additions and 13 deletions

View File

@ -3,7 +3,7 @@
import { store, allScreens } from "builderStore" import { store, allScreens } from "builderStore"
import { notifications } from "@budibase/bbui" import { notifications } from "@budibase/bbui"
import ConfirmDialog from "components/common/ConfirmDialog.svelte" import ConfirmDialog from "components/common/ConfirmDialog.svelte"
import { Icon, Popover } from "@budibase/bbui" import { ActionMenu, MenuItem, Icon, Popover } from "@budibase/bbui"
import { DropdownContainer, DropdownItem } from "components/common/Dropdowns" import { DropdownContainer, DropdownItem } from "components/common/Dropdowns"
export let screenId export let screenId
@ -25,22 +25,20 @@
notifications.error("Error deleting screen") notifications.error("Error deleting screen")
} }
} }
const openModal = () => {
confirmDeleteDialog.show()
dropdown.hide()
}
</script> </script>
<div bind:this={anchor} on:click|stopPropagation> <ActionMenu bind:this={dropdown}>
<div class="icon" on:click={() => dropdown.show()}> <div slot="button" class="icon" on:click={dropdown.show}>
<Icon s hoverable name="MoreSmallList" /> <Icon s hoverable name="MoreSmallList" />
</div> </div>
<Popover bind:this={dropdown} {anchor} align="left"> <MenuItem icon="Delete" on:click={openModal}>Delete</MenuItem>
<DropdownContainer> </ActionMenu>
<DropdownItem
icon="ri-delete-bin-line"
title="Delete"
on:click={() => confirmDeleteDialog.show()}
/>
</DropdownContainer>
</Popover>
</div>
<ConfirmDialog <ConfirmDialog
bind:this={confirmDeleteDialog} bind:this={confirmDeleteDialog}
title="Confirm Deletion" title="Confirm Deletion"