From 64bde81e26ea84f95c0f4cc02d3b2dbfd9dcf1b7 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 15 Nov 2023 23:02:29 -0800 Subject: prefill register page --- src/routes/+page.svelte | 109 +++++++++++++++++++++++++----------------------- 1 file changed, 57 insertions(+), 52 deletions(-) (limited to 'src/routes/+page.svelte') diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 0aaf887d..9d2ba213 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -12,11 +12,11 @@ import { t } from '$lib/translations'; import { close } from '$lib/socket'; - import { onMount } from 'svelte'; + import { onDestroy, onMount } from 'svelte'; export let data; - let { locations, user } = data; - let update = (data) => ({ locations, user } = data); + let { faqs, locations, user } = data; + let update = (data) => ({ faqs, locations, user } = data); $: update(data); let howItWorks; @@ -24,7 +24,6 @@ let about; let log = console.log; - let faqs = {}; const howItWorksSteps = [ { image: 'hand', stepID: 'step1' }, @@ -32,9 +31,9 @@ { image: 'smile', stepID: 'step3' } ]; - onMount(async () => { - faqs = (await import('../locales/en.json')).default.faq; + let loaded; + onMount(async () => { close(); try { @@ -42,62 +41,68 @@ } catch (e) { console.log(e); } + + loaded = true; }); + + onDestroy(() => (loaded = false)); - - -
- - - - - {$t('landing.info2.description1')} -

- {$t('landing.info2.description2')} -

- {@html $t('landing.info2.description3')} -
- -
+{#if loaded} + + +
+ -
-
-
- -
-

{$t('howItWorks.header')}

-
- {#each howItWorksSteps as step} - - {/each} + + + {$t('landing.info2.description1')} +

+ {$t('landing.info2.description2')} +

+ {@html $t('landing.info2.description3')} +
+ +
+ +
+
+
+ +
+

{$t('howItWorks.header')}

+
+ {#each howItWorksSteps as step} + + {/each} +
+
-
-
- -
-
-

{$t('faq.header')}

- {#each Object.keys(faqs).filter((f) => f !== 'header') as faqID} - - {/each} + +
+
+

{$t('faq.header')}

+ {#each faqs as f} + + {/each} +
+
-
-
- -
+ +
-