From f9f7dcc8eb86e58af04adacd797f6de69a8816b9 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Sun, 11 Feb 2024 12:35:56 -0800 Subject: feat(layout): profile dropdown --- src/routes/+layout.svelte | 51 +++++++++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 22 deletions(-) (limited to 'src/routes') diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 61d425f2..dfb3a278 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -125,9 +125,32 @@ {#if data.user} - - {$locale().navigation.profile} - + { + localStorage.removeItem('identity'); + localStorage.removeItem('commit'); + + document.cookie = 'user=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;'; + + window.location.href = root('/api/authentication/log-out'); + } + } + ]} + header={false} + > + + {$locale().navigation.profile} + + {/if} {#if data.user === undefined} @@ -143,26 +166,10 @@ > {$locale().navigation.logIn} - {:else} - { - localStorage.removeItem('identity'); - localStorage.removeItem('commit'); - - document.cookie = 'user=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;'; - - window.location.href = root('/api/authentication/log-out'); - }} - > - {$locale().navigation.logOut} + {:else if data.user} + + Avatar - {#if data.user} - - Avatar - - {/if} {/if} -- cgit v1.2.3