Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions src/lib/components/empty.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import { trackEvent } from '$lib/actions/analytics';

export let single = false;
export let noMedia = false;
export let target: string = null;
export let href: string = null;

Expand All @@ -23,17 +24,19 @@
<article class="card u-grid u-cross-center u-width-full-line common-section">
<div
class="u-flex u-flex-vertical u-cross-center u-gap-24 u-width-full-line u-overflow-hidden">
<button
type="button"
on:click|preventDefault
on:click={track}
aria-label="create {target}">
{#if $app.themeInUse === 'dark'}
<img src={EmptyDark} alt="create" aria-hidden="true" width="376" />
{:else}
<img src={EmptyLight} alt="create" aria-hidden="true" width="376" />
{/if}
</button>
{#if !noMedia}
<button
type="button"
on:click|preventDefault
on:click={track}
aria-label="create {target}">
{#if $app.themeInUse === 'dark'}
<img src={EmptyDark} alt="create" aria-hidden="true" width="376" />
{:else}
<img src={EmptyLight} alt="create" aria-hidden="true" width="376" />
{/if}
</button>
{/if}
<slot>
<div class="u-text-center">
<Heading size="7" tag="h2" trimmed={false}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,25 @@
</div>
</svelte:fragment>
</CardGrid>
{:else if $deploymentList.total}
<Empty noMedia single>
<Create secondary round>
<i class="icon-plus" />
</Create>
<div class="u-text-center">
<p class="body-text-2 u-margin-block-start-4">
Add a new deployment, or activate an existing one to see your function in
action. <br />Learn more about deployments in our
<a
class="link"
target="_blank"
rel="noopener noreferrer"
href="https://appwrite.io/docs/products/functions/deployment"
>documentation</a
>.
</p>
</div>
</Empty>
{:else}
<Empty single target="deployment">
<div class="u-text-center">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import { showCreateDeployment } from './store';

export let secondary = false;
export let round = false;
// This allows us to know which one to open when the user uses the shortcut in the command center
export let main = false;
let show = false;
Expand All @@ -23,11 +24,13 @@
</script>

<DropList bind:show placement="bottom-end">
<Button {secondary} on:click={() => (show = !show)} event="create_deployment">
{#if !secondary}
<span class="icon-plus" aria-hidden="true" />
{/if}
<span class="text">Create deployment</span>
<Button {secondary} {round} on:click={() => (show = !show)} event="create_deployment">
<slot>
{#if !secondary}
<span class="icon-plus" aria-hidden="true" />
{/if}
<span class="text">Create deployment</span>
</slot>
</Button>
<svelte:fragment slot="list">
<DropListItem
Expand Down