Use discrete buttons with text for adding screens and components

This commit is contained in:
Andrew Kingston 2022-07-22 12:10:53 +01:00
parent 03d6a75af8
commit d266b6ca84
2 changed files with 15 additions and 14 deletions

View File

@ -9,6 +9,7 @@
import { setContext } from "svelte" import { setContext } from "svelte"
import DNDPositionIndicator from "./DNDPositionIndicator.svelte" import DNDPositionIndicator from "./DNDPositionIndicator.svelte"
import { DropPosition } from "./dndStore" import { DropPosition } from "./dndStore"
import { Button, Layout } from "@budibase/bbui"
let scrollRef let scrollRef
@ -61,13 +62,10 @@
}) })
</script> </script>
<Panel <Panel title="Components" showExpandIcon borderRight>
title="Components" <div class="add-component">
showAddButton <Button on:click={() => $goto("../new")} cta>Add component</Button>
onClickAddButton={() => $goto("../new")} </div>
showExpandIcon
borderRight
>
<div class="nav-items-container" bind:this={scrollRef}> <div class="nav-items-container" bind:this={scrollRef}>
<ul> <ul>
<li <li
@ -110,6 +108,13 @@
</Panel> </Panel>
<style> <style>
.add-component {
padding: var(--spacing-xl) var(--spacing-l);
padding-bottom: 0;
display: flex;
flex-direction: column;
align-items: stretch;
}
.nav-items-container { .nav-items-container {
padding: var(--spacing-xl) 0; padding: var(--spacing-xl) 0;
flex: 1 1 auto; flex: 1 1 auto;

View File

@ -1,5 +1,5 @@
<script> <script>
import { Search, Layout, Select, Body } from "@budibase/bbui" import { Search, Layout, Select, Body, Button } from "@budibase/bbui"
import Panel from "components/design/Panel.svelte" import Panel from "components/design/Panel.svelte"
import { roles } from "stores/backend" import { roles } from "stores/backend"
import { store, sortedScreens } from "builderStore" import { store, sortedScreens } from "builderStore"
@ -28,13 +28,9 @@
} }
</script> </script>
<Panel <Panel title="Screens" borderRight>
title="Screens"
showAddButton
onClickAddButton={showNewScreenModal}
borderRight
>
<Layout paddingX="L" paddingY="XL" gap="S"> <Layout paddingX="L" paddingY="XL" gap="S">
<Button on:click={showNewScreenModal} cta>Add screen</Button>
<Search <Search
placeholder="Search" placeholder="Search"
value={searchString} value={searchString}