|
11 | 11 | import { isServiceLimited } from '$lib/stores/billing';
|
12 | 12 | import { organization } from '$lib/stores/organization';
|
13 | 13 | import { canWriteSites } from '$lib/stores/roles.js';
|
14 |
| - import { Icon, Layout } from '@appwrite.io/pink-svelte'; |
| 14 | + import { Card, Icon, Layout, Typography } from '@appwrite.io/pink-svelte'; |
15 | 15 | import { Button } from '$lib/elements/forms';
|
16 | 16 | import { app } from '$lib/stores/app';
|
17 | 17 | import CreateSiteModal from './createSiteModal.svelte';
|
18 | 18 | import EmptyLight from './(images)/empty-sites-light.svg';
|
19 | 19 | import EmptyDark from './(images)/empty-sites-dark.svg';
|
| 20 | + import EmptyLightMobile from './(images)/empty-sites-light-mobile.svg'; |
| 21 | + import EmptyDarkMobile from './(images)/empty-sites-dark-mobile.svg'; |
20 | 22 | import Grid from './grid.svelte';
|
21 | 23 | import { IconPlus } from '@appwrite.io/pink-icons-svelte';
|
22 | 24 | import { columns } from './store';
|
|
26 | 28 | import { invalidate } from '$app/navigation';
|
27 | 29 | import { Dependencies } from '$lib/constants';
|
28 | 30 | import { sdk } from '$lib/stores/sdk';
|
| 31 | + import { isSmallViewport } from '$lib/stores/viewport'; |
29 | 32 |
|
30 | 33 | export let data;
|
31 | 34 |
|
|
55 | 58 | }
|
56 | 59 | });
|
57 | 60 | });
|
| 61 | +
|
| 62 | + $: isDark = $app.themeInUse === 'dark'; |
| 63 | + $: imgSrc = isDark |
| 64 | + ? $isSmallViewport |
| 65 | + ? EmptyDarkMobile |
| 66 | + : EmptyDark |
| 67 | + : $isSmallViewport |
| 68 | + ? EmptyLightMobile |
| 69 | + : EmptyLight; |
| 70 | + $: imgClass = $isSmallViewport ? 'mobile' : 'desktop'; |
58 | 71 | </script>
|
59 | 72 |
|
60 | 73 | <Container>
|
61 |
| - <Layout.Stack direction="row" justifyContent="space-between"> |
62 |
| - <Layout.Stack direction="row" alignItems="center"> |
63 |
| - <SearchQuery placeholder="Search by name" /> |
| 74 | + {#if data.sitesLive} |
| 75 | + <Layout.Stack direction="row" justifyContent="space-between"> |
| 76 | + <Layout.Stack direction="row" alignItems="center"> |
| 77 | + <SearchQuery placeholder="Search by name" /> |
| 78 | + </Layout.Stack> |
| 79 | + <Layout.Stack direction="row" alignItems="center" justifyContent="flex-end"> |
| 80 | + <ViewSelector |
| 81 | + {columns} |
| 82 | + view={data.view} |
| 83 | + hideColumns |
| 84 | + hideView={!data.siteList.total} /> |
| 85 | + {#if $canWriteSites} |
| 86 | + <Button on:mousedown={() => (show = true)} event="create_site" size="s"> |
| 87 | + <Icon icon={IconPlus} slot="start" size="s" /> |
| 88 | + Create site |
| 89 | + </Button> |
| 90 | + {/if} |
| 91 | + </Layout.Stack> |
64 | 92 | </Layout.Stack>
|
65 |
| - <Layout.Stack direction="row" alignItems="center" justifyContent="flex-end"> |
66 |
| - <ViewSelector {columns} view={data.view} hideColumns hideView={!data.siteList.total} /> |
67 |
| - {#if $canWriteSites} |
68 |
| - <Button on:mousedown={() => (show = true)} event="create_site" size="s"> |
69 |
| - <Icon icon={IconPlus} slot="start" size="s" /> |
70 |
| - Create site |
71 |
| - </Button> |
| 93 | + {#if data.siteList.total} |
| 94 | + {#if data.view === View.Grid} |
| 95 | + <Grid siteList={data.siteList} /> |
| 96 | + {:else} |
| 97 | + <Table siteList={data.siteList} /> |
72 | 98 | {/if}
|
73 |
| - </Layout.Stack> |
74 |
| - </Layout.Stack> |
75 |
| - {#if data.siteList.total} |
76 |
| - {#if data.view === View.Grid} |
77 |
| - <Grid siteList={data.siteList} /> |
| 99 | + <PaginationWithLimit |
| 100 | + name="Sites" |
| 101 | + limit={data.limit} |
| 102 | + offset={data.offset} |
| 103 | + total={data.siteList.total} /> |
| 104 | + {:else if data.search} |
| 105 | + <EmptySearch target="sites" /> |
78 | 106 | {:else}
|
79 |
| - <Table siteList={data.siteList} /> |
| 107 | + <Empty |
| 108 | + single |
| 109 | + allowCreate={$canWriteSites} |
| 110 | + href="https://appwrite.io/docs/products/sites" |
| 111 | + description="Deploy and manage your web your web applications with Sites. " |
| 112 | + target="site" |
| 113 | + src={$app.themeInUse === 'dark' ? EmptyDark : EmptyLight} |
| 114 | + on:click={() => (show = true)}> |
| 115 | + </Empty> |
80 | 116 | {/if}
|
81 |
| - <PaginationWithLimit |
82 |
| - name="Sites" |
83 |
| - limit={data.limit} |
84 |
| - offset={data.offset} |
85 |
| - total={data.siteList.total} /> |
86 |
| - {:else if data.search} |
87 |
| - <EmptySearch target="sites" /> |
88 | 117 | {:else}
|
89 |
| - <Empty |
90 |
| - single |
91 |
| - allowCreate={$canWriteSites} |
92 |
| - href="https://appwrite.io/docs/products/sites" |
93 |
| - description="Deploy and manage your web your web applications with Sites. " |
94 |
| - target="site" |
95 |
| - src={$app.themeInUse === 'dark' ? EmptyDark : EmptyLight} |
96 |
| - on:click={() => (show = true)}> |
97 |
| - </Empty> |
| 118 | + <Card.Base padding="m"> |
| 119 | + <Layout.Stack gap="xxl"> |
| 120 | + <img src={imgSrc} alt="create" aria-hidden="true" height="242" class={imgClass} /> |
| 121 | + |
| 122 | + <Layout.Stack> |
| 123 | + <Layout.Stack gap="m" alignItems="center"> |
| 124 | + <Typography.Title size="s" align="center" color="--fgcolor-neutral-primary"> |
| 125 | + Appwrite Sites is in high demand |
| 126 | + </Typography.Title> |
| 127 | + |
| 128 | + <div style:max-width="600px"> |
| 129 | + <Typography.Text align="center" color="--fgcolor-neutral-secondary"> |
| 130 | + To ensure a smooth experience for everyone, we’re rolling out access |
| 131 | + gradually. |
| 132 | + </Typography.Text> |
| 133 | + </div> |
| 134 | + </Layout.Stack> |
| 135 | + </Layout.Stack> |
| 136 | + </Layout.Stack> |
| 137 | + </Card.Base> |
98 | 138 | {/if}
|
99 | 139 | </Container>
|
100 | 140 |
|
|
0 commit comments