|
1 | 1 | <script lang="ts">
|
| 2 | + import { browser } from '$app/environment'; |
2 | 3 | import { goto } from '$app/navigation';
|
3 | 4 | import { base } from '$app/paths';
|
4 | 5 | import { Button, Form, FormList, InputChoice } from '$lib/elements/forms';
|
|
43 | 44 | <title>Accept invite - Appwrite</title>
|
44 | 45 | </svelte:head>
|
45 | 46 |
|
| 47 | +<!-- if browser checks allow us to partially prerender on the server to improve FCP and LCP --> |
46 | 48 | <Unauthenticated>
|
47 |
| - <svelte:fragment slot="title"> |
48 |
| - {#if !userId || !secret || !membershipId || !teamId} |
49 |
| - Invalid invite |
50 |
| - {:else} |
51 |
| - Invite |
52 |
| - {/if} |
| 49 | + <svelte:fragment slot="title" |
| 50 | + ><span |
| 51 | + >{#if browser} |
| 52 | + {#if !userId || !secret || !membershipId || !teamId} |
| 53 | + Invalid invite |
| 54 | + {:else} |
| 55 | + Invite |
| 56 | + {/if}{/if}</span> |
53 | 57 | </svelte:fragment>
|
54 |
| - <svelte:fragment> |
55 |
| - {#if !userId || !secret || !membershipId || !teamId} |
56 |
| - <Alert type="warning"> |
57 |
| - <svelte:fragment slot="title">The invite link is not valid</svelte:fragment> |
58 |
| - Please ask the project owner to send you a new invite. |
59 |
| - </Alert> |
60 |
| - <div class="u-flex u-main-end u-margin-block-start-40"> |
61 |
| - <Button href={`${base}/register`}>Sign up to Appwrite</Button> |
62 |
| - </div> |
63 |
| - {:else} |
64 |
| - <p class="text">You have been invited to join a team project on Appwrite</p> |
65 |
| - <Form onSubmit={acceptInvite}> |
66 |
| - <FormList> |
67 |
| - <InputChoice |
68 |
| - required |
69 |
| - bind:value={terms} |
70 |
| - id="terms" |
71 |
| - label="terms" |
72 |
| - showLabel={false}> |
73 |
| - By accepting the invitation, you agree to the <a |
74 |
| - class="link" |
75 |
| - href="https://appwrite.io/terms" |
76 |
| - target="_blank" |
77 |
| - rel="noopener noreferrer">Terms and Conditions</a> |
78 |
| - and |
79 |
| - <a |
80 |
| - class="link" |
81 |
| - href="https://appwrite.io/privacy" |
82 |
| - target="_blank" |
83 |
| - rel="noopener noreferrer"> |
84 |
| - Privacy Policy</a |
85 |
| - >.</InputChoice> |
86 |
| - |
87 |
| - <div class="u-flex u-main-end u-gap-12"> |
88 |
| - <Button secondary href={`${base}/login`}>Cancel</Button> |
89 |
| - <Button submit>Accept</Button> |
| 58 | + <svelte:fragment |
| 59 | + ><div> |
| 60 | + {#if browser} |
| 61 | + {#if !userId || !secret || !membershipId || !teamId} |
| 62 | + <Alert type="warning"> |
| 63 | + <svelte:fragment slot="title">The invite link is not valid</svelte:fragment> |
| 64 | + Please ask the project owner to send you a new invite. |
| 65 | + </Alert> |
| 66 | + <div class="u-flex u-main-end u-margin-block-start-40"> |
| 67 | + <Button href={`${base}/register`}>Sign up to Appwrite</Button> |
90 | 68 | </div>
|
91 |
| - </FormList> |
92 |
| - </Form> |
93 |
| - {/if} |
| 69 | + {:else} |
| 70 | + <p class="text">You have been invited to join a team project on Appwrite</p> |
| 71 | + <Form onSubmit={acceptInvite}> |
| 72 | + <FormList> |
| 73 | + <InputChoice |
| 74 | + required |
| 75 | + bind:value={terms} |
| 76 | + id="terms" |
| 77 | + label="terms" |
| 78 | + showLabel={false}> |
| 79 | + By accepting the invitation, you agree to the <a |
| 80 | + class="link" |
| 81 | + href="https://appwrite.io/terms" |
| 82 | + target="_blank" |
| 83 | + rel="noopener noreferrer">Terms and Conditions</a> |
| 84 | + and |
| 85 | + <a |
| 86 | + class="link" |
| 87 | + href="https://appwrite.io/privacy" |
| 88 | + target="_blank" |
| 89 | + rel="noopener noreferrer"> |
| 90 | + Privacy Policy</a |
| 91 | + >.</InputChoice> |
| 92 | + |
| 93 | + <div class="u-flex u-main-end u-gap-12"> |
| 94 | + <Button secondary href={`${base}/login`}>Cancel</Button> |
| 95 | + <Button submit>Accept</Button> |
| 96 | + </div> |
| 97 | + </FormList> |
| 98 | + </Form> |
| 99 | + {/if}{/if} |
| 100 | + </div> |
94 | 101 | </svelte:fragment>
|
95 | 102 | </Unauthenticated>
|
0 commit comments