Skip to content

Commit

Permalink
Add side nav tabs for bindings and state
Browse files Browse the repository at this point in the history
  • Loading branch information
aptkingston committed Jan 17, 2025
1 parent ea8a746 commit c902c66
Showing 1 changed file with 39 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,41 @@
<script>
<script lang="ts">
import ScreenList from "./ScreenList/index.svelte"
import ComponentList from "./ComponentList/index.svelte"
import { getHorizontalResizeActions } from "@/components/common/resizable"
import { ActionButton } from "@budibase/bbui"
const [resizable, resizableHandle] = getHorizontalResizeActions()
enum Tabs {
Components = "Components",

Check failure on line 10 in packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/LeftPanel.svelte

View workflow job for this annotation

GitHub Actions / lint

'Components' is defined but never used. Allowed unused vars must match /^_/u
Bindings = "Bindings",

Check failure on line 11 in packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/LeftPanel.svelte

View workflow job for this annotation

GitHub Actions / lint

'Bindings' is defined but never used. Allowed unused vars must match /^_/u
State = "State",

Check failure on line 12 in packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/LeftPanel.svelte

View workflow job for this annotation

GitHub Actions / lint

'State' is defined but never used. Allowed unused vars must match /^_/u
}
let activeTab = Tabs.Components
</script>

<div class="panel" use:resizable>
<div class="content">
<ScreenList />
<ComponentList />
<div class="tabs">
{#each Object.values(Tabs) as tab}
<ActionButton
quiet
selected={activeTab === tab}
on:click={() => (activeTab = tab)}
>
{tab}
</ActionButton>
{/each}
</div>
{#if activeTab === Tabs.Components}
<ComponentList />
{:else if activeTab === Tabs.Bindings}
<div class="tab-content">Bindings</div>
{:else if activeTab === Tabs.State}
<div class="tab-content">State</div>
{/if}
</div>
<div class="divider">
<div class="dividerClickExtender" role="separator" use:resizableHandle />
Expand All @@ -34,6 +60,17 @@
position: relative;
}
.tabs {
display: flex;
flex-direction: row;
gap: 8px;
padding: var(--spacing-m) var(--spacing-l);
border-bottom: var(--border-light);
}
.tab-content {
padding: var(--spacing-l);
}
.divider {
position: relative;
height: 100%;
Expand All @@ -45,7 +82,6 @@
background: var(--spectrum-global-color-gray-300);
cursor: row-resize;
}
.dividerClickExtender {
position: absolute;
cursor: col-resize;
Expand Down

0 comments on commit c902c66

Please sign in to comment.