1
0
Fork 0
mirror of synced 2024-09-30 09:07:25 +13:00

Allow adding blocks from new UI

This commit is contained in:
Andrew Kingston 2022-04-26 16:41:05 +01:00
parent 3ac278b77e
commit 00659b4109

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>