Oprava Profile (routes), Layouts in Profile

This commit is contained in:
Ota Prokopec 2023-03-14 18:57:59 +01:00
parent 2a781be8e0
commit f24a7b8a76
6 changed files with 26 additions and 16 deletions

View File

@ -55,5 +55,6 @@
width: 100%;
position: relative;
max-width: var(--max-viewport-width);
padding: 10px;
}
</style>

View File

@ -5,6 +5,7 @@
import Loading from '$src/__loading.svelte'
import Error from '$src/__error.svelte'
import NavigationBarLayout from '$lib/components/Layouts/NavigationBarLayout.svelte'
import ArrowBackLayout from '$lib/components/Layouts/ArrowBackLayout.svelte'
</script>
<Router
@ -50,7 +51,7 @@
{
path: '/profile/setting/:function',
component: () => import('$routes/profile/profile-functions.svelte'),
layout: NavigationBarLayout,
layout: ArrowBackLayout,
},
{
path: '/login',

View File

@ -0,0 +1,16 @@
<script lang="ts">
import { navigate } from '$lib/router'
import ArrowBack from '$lib/svg/ArrowBack.svelte'
</script>
<div class="w-full h-auto flex flex-wrap flex-col">
<button
class="absolute mt-4 z-50"
on:click={() => {
navigate(-1)
}}
>
<ArrowBack />
</button>
<slot />
</div>

View File

@ -24,15 +24,8 @@
}
</script>
<div class="main">
<div class="main w-full">
<div class="head">
<button
on:click={() => {
navigate('/profile')
}}
>
<ArrowBack />
</button>
<h1>{data.display_name}</h1>
</div>
@ -45,7 +38,7 @@
flex-direction: column;
align-items: center;
justify-content: stretch;
height: 100%;
height: auto;
.head {
width: 100%;
display: flex;

View File

@ -16,10 +16,9 @@
import collections from '$lib/collections'
import { Query } from 'appwrite'
export let params: { erantId: string }
//
$: [userInfo] = collections.users.getDocument([Query.equal('userID', params.erantId)])
$: [userInfo] = collections.users.getDocument([Query.equal('erantId', params.erantId)])
$: console.log($user)