|
29 | 29 | import { Dependencies } from '$lib/constants';
|
30 | 30 | import { sdk } from '$lib/stores/sdk';
|
31 | 31 | import { isSmallViewport } from '$lib/stores/viewport';
|
| 32 | + import { addNotification } from '$lib/stores/notifications'; |
| 33 | + import { isOnWaitlistSites, joinWaitlistSites } from '$lib/helpers/waitlist'; |
| 34 | + import { user } from '$lib/stores/user'; |
32 | 35 |
|
33 | 36 | export let data;
|
34 | 37 |
|
35 | 38 | let show = false;
|
| 39 | + let isOnWaitlist = isOnWaitlistSites($user); |
36 | 40 |
|
37 | 41 | $: $registerCommands([
|
38 | 42 | {
|
|
68 | 72 | ? EmptyLightMobile
|
69 | 73 | : EmptyLight;
|
70 | 74 | $: imgClass = $isSmallViewport ? 'mobile' : 'desktop';
|
| 75 | +
|
| 76 | + function addToWaitlist() { |
| 77 | + joinWaitlistSites($user); |
| 78 | + addNotification({ |
| 79 | + type: 'success', |
| 80 | + title: 'Waitlist joined', |
| 81 | + message: "We'll let you know as soon as Appwrite Sites is ready for you." |
| 82 | + }); |
| 83 | +
|
| 84 | + isOnWaitlist = true; |
| 85 | + } |
71 | 86 | </script>
|
72 | 87 |
|
73 | 88 | <Container>
|
|
120 | 135 | <img src={imgSrc} alt="create" aria-hidden="true" height="242" class={imgClass} />
|
121 | 136 |
|
122 | 137 | <Layout.Stack>
|
123 |
| - <Layout.Stack gap="m" alignItems="center"> |
| 138 | + {#if isOnWaitlist} |
124 | 139 | <Typography.Title size="s" align="center" color="--fgcolor-neutral-primary">
|
125 |
| - Appwrite Sites is in high demand |
| 140 | + You've successfully joined the Sites waitlist |
126 | 141 | </Typography.Title>
|
127 | 142 |
|
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> |
| 143 | + <Typography.Text align="center" color="--fgcolor-neutral-secondary"> |
| 144 | + We can't wait for you to try out Sites on Cloud. You will get access |
| 145 | + soon. |
| 146 | + </Typography.Text> |
| 147 | + {:else} |
| 148 | + <Layout.Stack gap="m" alignItems="center"> |
| 149 | + <Typography.Title |
| 150 | + size="s" |
| 151 | + align="center" |
| 152 | + color="--fgcolor-neutral-primary"> |
| 153 | + Appwrite Sites is in high demand |
| 154 | + </Typography.Title> |
| 155 | + |
| 156 | + <div style:max-width="600px"> |
| 157 | + <Typography.Text align="center" color="--fgcolor-neutral-secondary"> |
| 158 | + To ensure a smooth experience for everyone, we’re rolling out |
| 159 | + access gradually. Join the waitlist and be one of the first to |
| 160 | + deploy with Sites. |
| 161 | + </Typography.Text> |
| 162 | + </div> |
| 163 | + |
| 164 | + <div style:margin-block-start="1rem"> |
| 165 | + <Button on:click={addToWaitlist}>Join waitlist</Button> |
| 166 | + </div> |
| 167 | + </Layout.Stack> |
| 168 | + {/if} |
135 | 169 | </Layout.Stack>
|
136 | 170 | </Layout.Stack>
|
137 | 171 | </Card.Base>
|
|
0 commit comments