1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-08-02 11:45:17 +02:00

Update user avatar component and settings page

This commit is contained in:
Sean Morley 2024-04-18 23:11:19 +00:00
parent f626370d3f
commit e372ebbacc
3 changed files with 8 additions and 3 deletions

2
src/app.d.ts vendored
View file

@ -3,7 +3,7 @@ declare global {
interface Locals {
user: import("lucia").User | null;
session: import("lucia").Session | null;
isServerSetup: boolean;
isServerSetup: boolean | null;
}
}
}

View file

@ -36,7 +36,12 @@
<p class="text-lg ml-4 font-bold">Hi, {user.first_name} {user.last_name}</p>
<li><a>Profile</a></li>
<li><button on:click={navToLog}>My Log</button></li>
<li><button on:click={navToSettings}>Settings</button></li>
<li><button on:click={navToSettings}>User Settings</button></li>
{#if user.role == "admin"}
<li>
<button on:click={() => goto("/settings/admin")}>Admin Settings</button>
</li>
{/if}
<form method="post">
<li><button formaction="/?/logout">Logout</button></li>
</form>

View file

@ -1,5 +1,6 @@
<script>
import { enhance } from "$app/forms";
import AdventureCard from "$lib/components/AdventureCard.svelte";
export let data;
let username = data.user?.username;
@ -14,7 +15,6 @@
<h1 class="text-center font-extrabold text-4xl mb-6">Settings Page</h1>
<h1 class="text-center font-extrabold text-xl">User Account Settings</h1>
<div class="flex justify-center">
<form method="post" use:enhance class="w-full max-w-xs">
<label for="username">Username</label>