1
0
Fork 0
mirror of synced 2024-07-08 15:56:23 +12:00

SettingsModal now uses Tabs component

This commit is contained in:
Keviin Åberg Kultalahti 2021-04-21 13:43:58 +02:00
parent 9968ca7695
commit 630acef7fc

View file

@ -1,28 +1,6 @@
<script>
import { General, DangerZone, APIKeys } from "./tabs"
import { Switcher, ModalContent } from "@budibase/bbui"
const tabs = [
{
title: "General",
key: "GENERAL",
component: General,
},
{
title: "API Keys",
key: "API_KEYS",
component: APIKeys,
},
{
title: "Danger Zone",
key: "DANGERZONE",
component: DangerZone,
},
]
let value = "GENERAL"
$: selectedTab = tabs.find(tab => tab.key === value).component
import { ModalContent, Tab, Tabs } from "@budibase/bbui"
</script>
<ModalContent
@ -30,9 +8,17 @@
showConfirmButton={false}
showCancelButton={false}>
<div class="container">
<Switcher headings={tabs} bind:value>
<svelte:component this={selectedTab} />
</Switcher>
<Tabs selected="General">
<Tab title="General">
<General />
</Tab>
<Tab title="API Keys">
<APIKeys />
</Tab>
<Tab title="Danger Zone">
<DangerZone />
</Tab>
</Tabs>
</div>
</ModalContent>