diff --git a/src/app.scss b/src/app.scss index 53aff9f..44251ab 100644 --- a/src/app.scss +++ b/src/app.scss @@ -18,8 +18,10 @@ --large-curve: 0.9375rem; } +html, body { margin: 0; + min-height: 100vh; } a { diff --git a/src/components/profile/Profile.svelte b/src/components/profile/Profile.svelte index f9e9fbb..82b00d1 100644 --- a/src/components/profile/Profile.svelte +++ b/src/components/profile/Profile.svelte @@ -2,13 +2,10 @@ import {onMount} from "svelte"; import {getUser} from "~/api/login"; import LazyDelay from "~/lib/LazyDelay.svelte"; + import type {ProfileData} from "~/stores/login"; export let id: "@me" | number; - let user: { - email: string; - username: string; - display_name: string; - }; + let user: ProfileData; let userIcon = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+P+/HgAFhAJ/wlseKgAAAABJRU5ErkJggg=="; onMount(async () => { diff --git a/src/components/settings/Settings.svelte b/src/components/settings/Settings.svelte new file mode 100644 index 0000000..813ca09 --- /dev/null +++ b/src/components/settings/Settings.svelte @@ -0,0 +1,50 @@ + + +
+
+ {#if $profileStore} +
Honestly I'm just too lazy to make this yet
+ {:else} + Loading... + {/if} +
+
+ + diff --git a/src/lib/HeaderDropdown.svelte b/src/lib/HeaderDropdown.svelte index 2cb171c..85313a9 100644 --- a/src/lib/HeaderDropdown.svelte +++ b/src/lib/HeaderDropdown.svelte @@ -7,19 +7,34 @@ let open = false; - function handleClick() { - open = !open; - } - function logoutAction() { loginStore.set(null); navigate("/"); } + + function clickOutside(element, callbackFunction) { + function onClick(event) { + if (!element.contains(event.target)) { + callbackFunction(); + } + } + + document.body.addEventListener("click", onClick); + + return { + update(newCallbackFunction) { + callbackFunction = newCallbackFunction; + }, + destroy() { + document.body.removeEventListener("click", onClick); + }, + }; + } -