Allow adding blocks from new UI
This commit is contained in:
parent
0f8eee4db9
commit
8ed59fa897
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue