1
0
Fork 0
mirror of synced 2024-10-03 02:27:06 +13:00

cleanup component selection list

This commit is contained in:
Keviin Åberg Kultalahti 2021-04-27 17:04:50 +02:00
parent c97fc61f77
commit e0a376dd7b

View file

@ -32,11 +32,8 @@
return enrichedStructure
}
const onItemChosen = async (item, idx) => {
if (item.isCategory) {
// Select and open this category
selectedIndex = idx
} else {
const onItemChosen = async (item) => {
if (!item.isCategory) {
// Add this component
await store.actions.components.create(item.component)
}
@ -44,15 +41,14 @@
</script>
<ActionGroup>
{#each enrichedStructure as item, idx}
{#each enrichedStructure as item}
<ActionMenu disabled={!item.isCategory}>
<ActionButton
icon={item.icon}
size="XS"
primary
quiet
slot="button"
on:click={() => onItemChosen(item, idx)}
slot="control"
on:click={() => onItemChosen(item)}
>
{item.name}
</ActionButton>