budibase/packages/builder/src/components/design/NavigationPanel/NewLayoutModal.svelte

22 lines
601 B
Svelte
Raw Normal View History

<script>
2021-03-17 12:40:24 +01:00
import { goto } from "@roxi/routify"
import { notifications } from "@budibase/bbui"
import { store } from "builderStore"
import { Input, ModalContent } from "@budibase/bbui"
let name = ""
2020-12-07 21:29:41 +01:00
async function save() {
try {
await store.actions.layouts.save({ name })
notifications.success(`Layout ${name} created successfully`)
2020-12-07 21:29:41 +01:00
} catch (err) {
notifications.error(`Error creating layout ${name}.`)
2020-12-07 21:29:41 +01:00
}
}
</script>
<ModalContent title="Create Layout" confirmText="Create" onConfirm={save}>
<Input thin label="Name" bind:value={name} />
</ModalContent>