Browse Source

Made action visibility react based on the number of loaded actions

master
Dean 4 years ago
parent
commit
f3b4856101
  1. 20
      packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/ButtonActionDrawer.svelte

20
packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/ButtonActionDrawer.svelte

@ -22,7 +22,7 @@
export let actions export let actions
export let bindings = [] export let bindings = []
let showAvailableActions = false $: showAvailableActions = !actions?.length
let actionQuery let actionQuery
$: parsedQuery = $: parsedQuery =
@ -114,12 +114,18 @@
<DrawerContent> <DrawerContent>
<Layout noPadding gap="S" slot="sidebar"> <Layout noPadding gap="S" slot="sidebar">
{#if showAvailableActions} {#if showAvailableActions || !actions?.length}
<div> {#if actions?.length > 0}
<ActionButton secondary icon={"ArrowLeft"} on:click={toggleActionList}> <div>
Back <ActionButton
</ActionButton> secondary
</div> icon={"ArrowLeft"}
on:click={toggleActionList}
>
Back
</ActionButton>
</div>
{/if}
<Search placeholder="Search" bind:value={actionQuery} /> <Search placeholder="Search" bind:value={actionQuery} />
{#each Object.entries(mappedActionTypes) as [categoryId, category]} {#each Object.entries(mappedActionTypes) as [categoryId, category]}
<div class="heading">{categoryId}</div> <div class="heading">{categoryId}</div>

Loading…
Cancel
Save