feat: step 3 placeholder

This commit is contained in:
Arman committed 2022-09-23 16:28:05 +02:00
1 parent efa7e52e9c
commit 045403c55c
3 files changed
+82 -2

No files matched your search

@@ -0,0 +1,33 @@
<script lang="ts">
import { Button, Form } from '$lib/elements/forms';
import { Modal } from '$lib/components';
import { createEventDispatcher } from 'svelte';
import { addNotification } from '$lib/stores/notifications';
export let showCreate = false;
const dispatch = createEventDispatcher();
const create = async () => {
try {
showCreate = false;
dispatch('created');
} catch (error) {
addNotification({
type: 'error',
message: error.message
});
}
};
</script>
<Form on:submit={create}>
<Modal bind:show={showCreate} size="big">
<svelte:fragment slot="header">Create Event</svelte:fragment>
<svelte:fragment slot="footer">
<Button secondary on:click={() => (showCreate = false)}>Cancel</Button>
<Button submit>Create</Button>
</svelte:fragment>
</Modal>
</Form>
@@ -62,8 +62,8 @@
<InputSwitch id="active" label="Activate Deployment after build" bind:value={active} />
{/if}
<svelte:fragment slot="footer">
<Button submit>Create</Button>
<Button secondary on:click={() => (showCreate = false)}>Cancel</Button>
<Button submit>Create</Button>
</svelte:fragment>
</Modal>
</Form>
@@ -1,6 +1,11 @@
<script lang="ts">
import { WizardStep } from '$lib/layout';
// import { createFunction } from './store';
import { Button } from '$lib/elements/forms';
import { Empty } from '$lib/components';
import { createFunction } from './store';
import Create from '../createEvent.svelte';
let showCreate = false;
</script>
<WizardStep>
@@ -10,4 +15,46 @@
</svelte:fragment>
EVENT
{#if $createFunction?.events?.length}
<div class="table-with-scroll">
<div class="table-wrapper">
<div class="table is-remove-outer-styles">
<ul class="table-thead">
{#each $createFunction.events as id}
<li class="table-row">
<div class="table-col" data-title="id">
<span class="text">{id}</span>
</div>
<div
class="table-col u-overflow-visible"
data-title="options"
style="--p-col-width:40">
<button
class="button is-text is-only-icon"
aria-label="delete id"
on:click={() => {
$createFunction.events = $createFunction.events.filter(
(item) => item !== id
);
$createFunction = $createFunction;
}}>
<span class="icon-x" aria-hidden="true" />
</button>
</div>
</li>
{/each}
</ul>
</div>
</div>
</div>
{:else}
<Empty dashed centered>Add a role to get started</Empty>
{/if}
<Button text on:click={() => (showCreate = !showCreate)}>
<span class="icon-plus" aria-hidden="true" />
<span class="u-text">Add event</span>
</Button>
</WizardStep>
<Create {showCreate} />