fix: broken empty components

This commit is contained in:
Arman
2022-09-30 11:28:16 +02:00
parent 9c869f122f
commit bb3bc4c042
5 changed files with 31 additions and 86 deletions
@@ -1,7 +1,7 @@
<script lang="ts">
import { page } from '$app/stores';
import { Button } from '$lib/elements/forms';
import { Empty, EmptyGridItem, Pagination, Copy, GridItem1 } from '$lib/components';
import { Empty, Pagination, Copy, GridItem1 } from '$lib/components';
import { Pill } from '$lib/elements';
import type { Models } from '@aw-labs/appwrite-console';
import Create from './createFunction.svelte';
@@ -102,16 +102,9 @@
</GridItem1>
{/each}
{#if ($functionList.total % 2 !== 0 || $functionList.total % 4 === 0) && $functionList.total - offset <= limit}
<EmptyGridItem on:click={openWizard}>
<div class="common-section">
<Button secondary round>
<i class="icon-plus" />
</Button>
</div>
<div class="common-section">
<p>Create a new function</p>
</div>
</EmptyGridItem>
<Empty on:click={openWizard}>
<p>Create a new function</p>
</Empty>
{/if}
</div>
@@ -120,24 +113,10 @@
<Pagination {limit} bind:offset sum={$functionList.total} />
</div>
{:else}
<Empty dashed centered>
<div class="u-flex u-flex-vertical u-cross-center">
<div class="common-section">
<Button secondary round on:click={openWizard}>
<i class="icon-plus" />
</Button>
</div>
<div class="common-section">
<p>Create your first function to get started</p>
</div>
<div class="common-section">
<Button
external
secondary
href="https://appwrite.io/docs/functions#createFunction"
>Documentation</Button>
</div>
</div>
<Empty isButton on:click={openWizard}>
<p>Create your first function to get started</p>
<Button external secondary href="https://appwrite.io/docs/functions#createFunction"
>Documentation</Button>
</Empty>
{/if}
</Container>
@@ -95,29 +95,20 @@
</svelte:fragment>
</CardGrid>
{:else}
<Empty dashed centered>
<div class="u-flex u-flex-vertical u-cross-center">
<div class="common-section">
<Button secondary round on:click={() => (showCreate = true)}>
<i class="icon-plus" />
</Button>
</div>
<div class="common-section">
<p class="u-text-center">
Add a new deployment, or activate an existing one to see your function
in action.
</p>
<p class="u-text-center">
Learn more about deployments in our <a
class="link"
href="https://appwrite.io/docs/functions#build"
target="_blank"
rel="noopener noreferrer">
Documentation</a
>.
</p>
</div>
</div>
<Empty isButton on:click={() => (showCreate = true)}>
<p class="u-text-center">
Add a new deployment, or activate an existing one to see your function in
action.
</p>
<p class="u-text-center">
Learn more about deployments in our <a
class="link"
href="https://appwrite.io/docs/functions#build"
target="_blank"
rel="noopener noreferrer">
Documentation</a
>.
</p>
</Empty>
{/if}
@@ -210,24 +201,10 @@
</TableBody>
</Table>
{:else}
<Empty dashed centered>
<div class="u-flex u-flex-vertical u-cross-center">
<div class="common-section">
<Button secondary round on:click={() => (showCreate = true)}>
<i class="icon-plus" />
</Button>
</div>
<div class="common-section">
<p>Create your first deployment to get started</p>
</div>
<div class="common-section">
<Button
external
secondary
href="https://appwrite.io/docs/functions#createFunction"
>Documentation</Button>
</div>
</div>
<Empty isButton single>
<p>Create your first deployment to get started</p>
<Button external secondary href="https://appwrite.io/docs/functions#createFunction"
>Documentation</Button>
</Empty>
{/if}
<div class="u-flex u-margin-block-start-32 u-main-space-between">
@@ -70,20 +70,9 @@
</TableBody>
</Table>
{:else}
<Empty dashed centered>
<div class="u-flex u-flex-vertical u-cross-center">
<div class="common-section">
<Button secondary round on:click={() => console.log('showCreate = true')}>
<i class="icon-plus" />
</Button>
</div>
<div class="common-section">
<p>Execute your function to view execution logs</p>
</div>
<div class="common-section">
<Button external secondary href="#">Documentation</Button>
</div>
</div>
<Empty isButton on:click={() => console.log('showCreate = true')}>
<p>Execute your function to view execution logs</p>
<Button external secondary href="#">Documentation</Button>
</Empty>
{/if}
<div class="u-flex u-margin-block-start-32 u-main-space-between">
@@ -63,7 +63,7 @@
</div>
</div>
{:else}
<Empty dashed centered>Add a role to get started</Empty>
<Empty single>Add a role to get started</Empty>
{/if}
<DropList bind:show={showDropdown} position="bottom" arrow={false}>
@@ -48,7 +48,7 @@
</div>
</div>
{:else}
<Empty dashed centered>Add a role to get started</Empty>
<Empty single>Add a role to get started</Empty>
{/if}
<Button text on:click={() => (showCreate = !showCreate)}>