budibase/packages/builder/src/components/settings/Modal.svelte

75 lines
1.5 KiB
Svelte
Raw Normal View History

2020-06-19 09:14:03 +02:00
<script>
import { General, Users, DangerZone, APIKeys } from "./tabs"
2020-06-19 09:14:03 +02:00
import { Input, TextArea, Button, Switcher } from "@budibase/bbui"
import { SettingsIcon, CloseIcon } from "components/common/Icons/"
import { getContext } from "svelte"
import { post } from "builderStore/api"
export let name = ""
export let description = ""
const tabs = [
{
title: "General",
key: "GENERAL",
component: General,
},
{
title: "Users",
key: "USERS",
component: Users,
},
{
title: "API Keys",
key: "API_KEYS",
component: APIKeys,
},
2020-06-19 09:14:03 +02:00
{
title: "Danger Zone",
key: "DANGERZONE",
component: DangerZone,
},
]
let value = "GENERAL"
$: selectedTab = tabs.find(tab => tab.key === value).component
</script>
<div class="container">
2020-09-30 11:24:16 +02:00
<div class="heading">
<i class="ri-settings-2-fill" />
<h3>Settings</h3>
2020-06-19 09:14:03 +02:00
</div>
2020-09-30 11:24:16 +02:00
<Switcher headings={tabs} bind:value>
<svelte:component this={selectedTab} />
</Switcher>
2020-06-19 09:14:03 +02:00
</div>
<style>
.container {
2020-10-01 12:29:43 +02:00
padding: 30px;
2020-09-30 11:24:16 +02:00
display: grid;
grid-gap: var(--spacing-xl);
2020-06-19 09:14:03 +02:00
}
2020-09-30 11:24:16 +02:00
.container :global(section > header) {
/* Fix margin defined in BBUI as L rather than XL */
margin-bottom: var(--spacing-xl);
2020-06-19 09:14:03 +02:00
}
2020-09-30 11:24:16 +02:00
2020-06-19 09:14:03 +02:00
.heading {
display: flex;
flex-direction: row;
align-items: center;
}
2020-09-30 11:24:16 +02:00
.heading h3 {
font-size: var(--font-size-xl);
color: var(--ink);
font-weight: 600;
2020-06-19 09:14:03 +02:00
margin: 0;
}
2020-09-30 11:24:16 +02:00
.heading i {
margin-right: var(--spacing-m);
font-size: 28px;
color: var(--grey-6);
2020-06-19 09:14:03 +02:00
}
</style>