Add option to paste inside screens

This commit is contained in:
Andrew Kingston 2022-03-07 13:56:06 +00:00
parent 4c88a046fd
commit d2b13cf3fa
1 changed files with 15 additions and 0 deletions

View File

@ -62,6 +62,14 @@
notifications.error("Error deleting screen")
}
}
const pasteComponent = mode => {
try {
store.actions.components.paste(screen?.props, mode)
} catch (error) {
notifications.error("Error saving component")
}
}
</script>
<ActionMenu>
@ -69,6 +77,13 @@
<Icon size="S" hoverable name="MoreSmallList" />
</div>
<MenuItem icon="Duplicate" on:click={duplicateScreen}>Duplicate</MenuItem>
<MenuItem
icon="ShowOneLayer"
on:click={() => pasteComponent("inside")}
disabled={!$store.componentToPaste}
>
Paste inside
</MenuItem>
<MenuItem icon="Delete" on:click={confirmDeleteDialog.show}>Delete</MenuItem>
</ActionMenu>