Skip to content

Commit

Permalink
Add login link to guest usernav
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenWeathers committed Apr 7, 2024
1 parent 803a324 commit dfdaf48
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions ui/src/components/global/NavUserMenu.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import UserAvatar from '../user/UserAvatar.svelte';
import { onMount } from 'svelte';
import VoteIcon from '../icons/VoteIcon.svelte';
import LockIcon from '../icons/LockIcon.svelte';
export let currentPage;
export let eventTag;
Expand Down Expand Up @@ -36,6 +37,11 @@
router.route(appRoutes.register, true);
}
function goToLogin() {
toggleMenu();
router.route(appRoutes.login, true);
}
function getProfile() {
xfetch(`/api/users/${$user.id}`)
.then(res => res.json())
Expand Down Expand Up @@ -121,6 +127,16 @@
<span>{$LL.createAccount()}</span>
</button>
</li>
<li class="flex">
<button
class="inline-flex items-center w-full px-2 py-1 font-semibold transition-colors duration-150 rounded-md hover:bg-gray-100 hover:text-gray-800 dark:hover:bg-gray-800 dark:hover:text-gray-200"
data-testid="login-link"
on:click="{goToLogin}"
>
<LockIcon class="w-4 h-4 me-3 " />
<span>{$LL.login()}</span>
</button>
</li>
{:else}
<li class="flex">
<button
Expand Down

0 comments on commit dfdaf48

Please sign in to comment.