diff --git a/src/lib/layout/header.svelte b/src/lib/layout/header.svelte index 01c063faf..1b8e7863e 100644 --- a/src/lib/layout/header.svelte +++ b/src/lib/layout/header.svelte @@ -21,6 +21,7 @@ import { Submit, trackEvent } from '$lib/actions/analytics'; import { sdkForConsole } from '$lib/stores/sdk'; import { slide } from 'svelte/transition'; + import { isCloud } from '$lib/system'; let showFeedback = false; let showDropdown = false; @@ -212,15 +213,17 @@ -
- - Claim your Cloud card - -
+ {#if isCloud} +
+ + Claim your Cloud card + +
+ {/if} {/if} diff --git a/src/routes/card/[uid]/+page.svelte b/src/routes/card/[uid]/+page.svelte index ab916bfcb..e3f908620 100644 --- a/src/routes/card/[uid]/+page.svelte +++ b/src/routes/card/[uid]/+page.svelte @@ -1,10 +1,7 @@ diff --git a/src/routes/card/[uid]/+page.ts b/src/routes/card/[uid]/+page.ts index 913a47f4e..c54acf617 100644 --- a/src/routes/card/[uid]/+page.ts +++ b/src/routes/card/[uid]/+page.ts @@ -1,6 +1,9 @@ import { redirect } from '@sveltejs/kit'; import { getCardImgUrls } from '../helpers.js'; +export const prerender = true; +export const ssr = true; + export async function load({ params }) { const userId = params.uid; const { frontImg } = getCardImgUrls(userId); diff --git a/src/routes/card/display.svelte b/src/routes/card/display.svelte index 7c110b36d..6250cef63 100644 --- a/src/routes/card/display.svelte +++ b/src/routes/card/display.svelte @@ -8,6 +8,7 @@ import { Modal } from '$lib/components'; import Code from '$lib/components/code.svelte'; import Button from '$lib/elements/forms/button.svelte'; + import { browser } from '$app/environment'; export let userId: string; export let variant: 'owner' | 'external'; @@ -29,7 +30,8 @@ const { frontImg, ogImg } = getCardImgUrls(userId); $: title = variant === 'owner' ? 'Welcome to the cloud' : 'Join the Appwrite Cloud'; - $: shareableLink = `${window.location.origin}/card/${userId}`; + $: shareableLink = + typeof window !== 'undefined' ? `${window.location.origin}/card/${userId}` : ''; $: embedCode = [ ``, `\tAppwrite Cloud Card`, @@ -71,7 +73,6 @@ - @@ -178,7 +179,9 @@ fallDistance="50px" /> {/if} - + {#if browser} + + {/if} {#if cardActive}