Don't show delete or duplicate actions in the component settings bar
This commit is contained in:
parent
2a7b90e46f
commit
312bc96770
|
@ -24,6 +24,9 @@
|
|||
}
|
||||
$: settings = getBarSettings(definition)
|
||||
|
||||
$: isScreen =
|
||||
$builderStore.selectedComponentId === $builderStore.screen?.props?._id
|
||||
|
||||
const getBarSettings = definition => {
|
||||
let allSettings = []
|
||||
definition?.settings?.forEach(setting => {
|
||||
|
@ -152,26 +155,30 @@
|
|||
{:else if setting.type === "color"}
|
||||
<SettingsColorPicker prop={setting.key} />
|
||||
{/if}
|
||||
{#if setting.barSeparator !== false}
|
||||
{#if setting.barSeparator !== false && (settings.length != idx + 1 || !isScreen)}
|
||||
<div class="divider" />
|
||||
{/if}
|
||||
{/each}
|
||||
<SettingsButton
|
||||
icon="Duplicate"
|
||||
on:click={() => {
|
||||
builderStore.actions.duplicateComponent(
|
||||
$builderStore.selectedComponentId
|
||||
)
|
||||
}}
|
||||
title="Duplicate component"
|
||||
/>
|
||||
<SettingsButton
|
||||
icon="Delete"
|
||||
on:click={() => {
|
||||
builderStore.actions.deleteComponent($builderStore.selectedComponentId)
|
||||
}}
|
||||
title="Delete component"
|
||||
/>
|
||||
{#if !isScreen}
|
||||
<SettingsButton
|
||||
icon="Duplicate"
|
||||
on:click={() => {
|
||||
builderStore.actions.duplicateComponent(
|
||||
$builderStore.selectedComponentId
|
||||
)
|
||||
}}
|
||||
title="Duplicate component"
|
||||
/>
|
||||
<SettingsButton
|
||||
icon="Delete"
|
||||
on:click={() => {
|
||||
builderStore.actions.deleteComponent(
|
||||
$builderStore.selectedComponentId
|
||||
)
|
||||
}}
|
||||
title="Delete component"
|
||||
/>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
|
|
Loading…
Reference in New Issue