Allow adding blocks from new UI
This commit is contained in:
parent
3ac278b77e
commit
00659b4109
|
@ -86,6 +86,7 @@
|
||||||
const addComponent = async item => {
|
const addComponent = async item => {
|
||||||
try {
|
try {
|
||||||
await store.actions.components.create(item.component)
|
await store.actions.components.create(item.component)
|
||||||
|
$goto("../")
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
notifications.error("Error creating component")
|
notifications.error("Error creating component")
|
||||||
}
|
}
|
||||||
|
@ -142,7 +143,7 @@
|
||||||
<Body>Blocks are a collection of pre-built components</Body>
|
<Body>Blocks are a collection of pre-built components</Body>
|
||||||
<Layout noPadding gap="XS">
|
<Layout noPadding gap="XS">
|
||||||
{#each blocks as block}
|
{#each blocks as block}
|
||||||
<div class="component block">
|
<div class="component block" on:click={() => addComponent(block)}>
|
||||||
<Icon name={block.icon} />
|
<Icon name={block.icon} />
|
||||||
<Body size="XS">{block.name}</Body>
|
<Body size="XS">{block.name}</Body>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue