From 6a1383b13ba879ef0083492c5ee6a3ffc795f1c0 Mon Sep 17 00:00:00 2001 From: kevmodrome Date: Tue, 19 Jan 2021 15:21:23 +0100 Subject: [PATCH] adds a empty state for no components added in the repeater --- packages/client/src/components/Component.svelte | 2 +- packages/standard-components/src/List.svelte | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/client/src/components/Component.svelte b/packages/client/src/components/Component.svelte index 23ba364dfb..7361573efd 100644 --- a/packages/client/src/components/Component.svelte +++ b/packages/client/src/components/Component.svelte @@ -29,7 +29,7 @@ $builderStore.previewType === "layout" || screenslotContext // Update component context - $: componentStore.set({ id, styles: { ...styles, id, allowSelection } }) + $: componentStore.set({ id, children: children.length, styles: { ...styles, id, allowSelection } }) // Gets the component constructor for the specified component const getComponentConstructor = component => { diff --git a/packages/standard-components/src/List.svelte b/packages/standard-components/src/List.svelte index f02b5e73c8..6c60c62c6f 100644 --- a/packages/standard-components/src/List.svelte +++ b/packages/standard-components/src/List.svelte @@ -28,7 +28,11 @@ {#if rows.length > 0} {#each rows as row} - + {#if $component.children === 0} +

Add some components to.

+ {:else} + + {/if}
{/each} {:else}