1
0
Fork 0
mirror of synced 2024-06-25 17:40:38 +12:00

Update section component to use new placeholder styles

This commit is contained in:
Andrew Kingston 2021-06-14 17:41:18 +01:00
parent a7aca00c99
commit a3f3039778
2 changed files with 13 additions and 2 deletions

View file

@ -58,6 +58,7 @@
"type": "select",
"label": "Direction",
"key": "direction",
"key": "direction",
"showInBar": true,
"options": [
{
@ -172,6 +173,7 @@
"styleable": true,
"transitionable": true,
"illegalChildren": ["Section"],
"showEmptyState": false,
"settings": [
{
"type": "section",

View file

@ -1,8 +1,10 @@
<script>
import { getContext } from "svelte"
import Placeholder from "./Placeholder.svelte"
const { styleable, transition } = getContext("sdk")
const { styleable, transition, builderStore } = getContext("sdk")
const component = getContext("component")
export let type = "mainSidebar"
export let gap = "16px"
export let minSize = 250
@ -36,7 +38,9 @@
<slot />
{#if layoutMap[type] - $component.children > 0}
{#each new Array(layoutMap[type] - $component.children) as _}
<p><i class="ri-image-line" />Add some components to display.</p>
<div class:placeholder={$builderStore.inBuilder}>
<Placeholder />
</div>
{/each}
{/if}
</div>
@ -79,4 +83,9 @@
font-size: 1.5rem;
color: var(--grey-5);
}
.placeholder {
border: 2px dashed var(--grey-5);
padding: var(--spacing-l);
}
</style>