Allow adding blocks from new UI

This commit is contained in:
Andrew Kingston 2022-04-26 16:41:05 +01:00
parent 0f8eee4db9
commit 8ed59fa897
1 changed files with 2 additions and 1 deletions

View File

@ -86,6 +86,7 @@
const addComponent = async item => {
try {
await store.actions.components.create(item.component)
$goto("../")
} catch (error) {
notifications.error("Error creating component")
}
@ -142,7 +143,7 @@
<Body>Blocks are a collection of pre-built components</Body>
<Layout noPadding gap="XS">
{#each blocks as block}
<div class="component block">
<div class="component block" on:click={() => addComponent(block)}>
<Icon name={block.icon} />
<Body size="XS">{block.name}</Body>
</div>