From 823e15f67135bc95d32222688c1ebd1ae942e37e Mon Sep 17 00:00:00 2001 From: Ota Prokopec Date: Tue, 21 Mar 2023 17:33:06 +0100 Subject: [PATCH] Layouting + game->experience renaming --- src/__routes.svelte | 51 ++++++++++++---------- src/routes/game/Forms/Renderer.svelte | 2 +- src/routes/game/experience.svelte | 2 +- src/routes/map/map.svelte | 4 +- src/routes/profile/profile.svelte | 62 +++++++++++++-------------- 5 files changed, 64 insertions(+), 57 deletions(-) diff --git a/src/__routes.svelte b/src/__routes.svelte index 396f755..c928e42 100644 --- a/src/__routes.svelte +++ b/src/__routes.svelte @@ -13,11 +13,31 @@ loading={Loading} error={Error} routes={[ - { - path: '/', - component: () => import('$routes/homepage/homepage.svelte'), - layout: NavigationBarLayout, - }, + ...[ + { + path: '/', + component: () => import('$routes/homepage/homepage.svelte'), + }, + { + path: '/explore', + component: () => import('$routes/explore/explore.svelte'), + }, + { + path: '/profile/:erantId', + component: () => import('$routes/profile/profile.svelte'), + }, + ].map((routes) => { + return { ...routes, layout: NavigationBarLayout } + }), + ...[ + { + path: '/profile/setting/:function', + component: () => import('$routes/profile/profile-functions.svelte'), + }, + ].map((routes) => { + return { ...routes, layout: NavigationBarLayout } + }), + { path: '/error', component: () => import('$routes/error.svelte'), @@ -34,25 +54,12 @@ path: '/map', component: () => import('$root/src/routes/map/map.svelte'), }, - { - path: '/explore', - component: () => import('$routes/explore/explore.svelte'), - layout: NavigationBarLayout, - }, + { path: '/profile/', component: () => import('$src/__error.svelte'), }, - { - path: '/profile/:erantId', - component: () => import('$routes/profile/profile.svelte'), - layout: NavigationBarLayout, - }, - { - path: '/profile/setting/:function', - component: () => import('$routes/profile/profile-functions.svelte'), - layout: ArrowBackLayout, - }, + { path: '/login', component: () => import('$routes/authorization/login/log_in.svelte'), @@ -76,7 +83,7 @@ }, { path: '/:gameurl', - component: () => import('$root/src/routes/game/experience.svelte'), + component: () => import('$routes/game/experience.svelte'), }, { path: '/terms-and-conditions', @@ -97,6 +104,6 @@ { path: '/preferences', component: () => import('$root/src/routes/onboarding/interestsPage.svelte'), - } + }, ]} /> diff --git a/src/routes/game/Forms/Renderer.svelte b/src/routes/game/Forms/Renderer.svelte index 19b3e57..3acb574 100644 --- a/src/routes/game/Forms/Renderer.svelte +++ b/src/routes/game/Forms/Renderer.svelte @@ -12,7 +12,7 @@ import Info from './Info.svelte' import { Experience } from '$lib/TStypes/experiences' import Layout from '../Components/Layout.svelte' - import { answer } from '$lib/utils/database/game' + import { answer } from '$lib/utils/database/experience' const components = { TEXT: TextForm, diff --git a/src/routes/game/experience.svelte b/src/routes/game/experience.svelte index f73633d..09504fe 100644 --- a/src/routes/game/experience.svelte +++ b/src/routes/game/experience.svelte @@ -92,7 +92,7 @@ {#if $data.checkPoints.length} - + {/if} {:else if view === 'experience-play'} diff --git a/src/routes/map/map.svelte b/src/routes/map/map.svelte index 24ca62b..cac1526 100644 --- a/src/routes/map/map.svelte +++ b/src/routes/map/map.svelte @@ -4,7 +4,7 @@ import LocationRequest from '$lib/components/Map/LocationRequest.svelte' import Marker from '$lib/components/Map/Marker.svelte' import { navigate } from '$lib/router' - import { getExpiriencesAsStore } from '$lib/utils/database/experience' + import { getExperiencesAsStore } from '$lib/utils/database/experience' import { onMount } from 'svelte' let user: { lat: number; lng: number } = { lat: 0, lng: 0 } @@ -19,7 +19,7 @@ navigator.geolocation.getCurrentPosition(handleLocationGranted) - $: [experiences] = getExpiriencesAsStore() + $: [experiences] = getExperiencesAsStore() diff --git a/src/routes/profile/profile.svelte b/src/routes/profile/profile.svelte index 1594fdd..692df58 100644 --- a/src/routes/profile/profile.svelte +++ b/src/routes/profile/profile.svelte @@ -20,8 +20,6 @@ // $: [userInfo] = collections.users.getDocument([Query.equal('erantId', params.erantId)]) - $: console.log($user) - const items = [ { title: 'Account', @@ -49,34 +47,36 @@ ] -{#if $userInfo} -
- - {$userInfo.userName} - - - Prague, Czechia - -
- +
+ {#if $userInfo} +
+ + {$userInfo.userName} + + + Prague, Czechia + +
+ -
- {#each items as { title, itms }} -
{title}
- {#each itms as { icon, text, link }} - {#if typeof link === 'function'} - - - - - {:else} - - - {text} - - - {/if} +
+ {#each items as { title, itms }} +
{title}
+ {#each itms as { icon, text, link }} + {#if typeof link === 'function'} + + + + + {:else} + + + {text} + + + {/if} + {/each} {/each} - {/each} -
-{/if} +
+ {/if} +