2020-06-19 09:14:03 +02:00
|
|
|
<script>
|
2020-07-02 17:28:33 +02:00
|
|
|
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"
|
|
|
|
|
|
|
|
const { open, close } = getContext("simple-modal")
|
|
|
|
export let name = ""
|
|
|
|
export let description = ""
|
|
|
|
const tabs = [
|
|
|
|
{
|
|
|
|
title: "General",
|
|
|
|
key: "GENERAL",
|
|
|
|
component: General,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: "Users",
|
|
|
|
key: "USERS",
|
|
|
|
component: Users,
|
|
|
|
},
|
2020-07-02 17:28:33 +02:00
|
|
|
{
|
|
|
|
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">
|
|
|
|
<div class="body">
|
|
|
|
<div class="heading">
|
|
|
|
<span class="icon">
|
|
|
|
<SettingsIcon />
|
|
|
|
</span>
|
|
|
|
<h3>Settings</h3>
|
|
|
|
</div>
|
|
|
|
<Switcher headings={tabs} bind:value>
|
|
|
|
<svelte:component this={selectedTab} />
|
|
|
|
</Switcher>
|
|
|
|
</div>
|
|
|
|
<div class="close-button" on:click={close}>
|
|
|
|
<CloseIcon />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
.container {
|
|
|
|
position: relative;
|
2020-07-12 20:19:12 +02:00
|
|
|
height: 36rem;
|
2020-06-19 09:14:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
.close-button {
|
|
|
|
cursor: pointer;
|
|
|
|
position: absolute;
|
|
|
|
top: 20px;
|
|
|
|
right: 20px;
|
|
|
|
}
|
|
|
|
.close-button :global(svg) {
|
|
|
|
width: 24px;
|
|
|
|
height: 24px;
|
|
|
|
}
|
|
|
|
.heading {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
align-items: center;
|
|
|
|
margin-bottom: 20px;
|
|
|
|
}
|
|
|
|
h3 {
|
|
|
|
margin: 0;
|
|
|
|
font-size: 24px;
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
.icon {
|
|
|
|
display: grid;
|
|
|
|
border-radius: 3px;
|
|
|
|
align-content: center;
|
|
|
|
justify-content: center;
|
|
|
|
margin-right: 12px;
|
|
|
|
height: 20px;
|
|
|
|
width: 20px;
|
|
|
|
padding: 10px;
|
|
|
|
background-color: var(--blue-light);
|
2020-07-12 20:19:12 +02:00
|
|
|
color: var(--grey-7);
|
2020-06-19 09:14:03 +02:00
|
|
|
}
|
|
|
|
.body {
|
2020-07-12 20:19:12 +02:00
|
|
|
padding: 40px 40px 40px 40px;
|
2020-06-19 09:14:03 +02:00
|
|
|
display: grid;
|
|
|
|
grid-gap: 20px;
|
|
|
|
}
|
|
|
|
</style>
|