Spaces:
Sleeping
Sleeping
Andrew
commited on
Commit
·
f653063
1
Parent(s):
e273a27
feat(ui): Add login button to NavMenu
Browse files
src/lib/components/NavMenu.svelte
CHANGED
|
@@ -15,6 +15,7 @@
|
|
| 15 |
import IconMoon from "$lib/components/icons/IconMoon.svelte";
|
| 16 |
import { switchTheme } from "$lib/switchTheme";
|
| 17 |
import { isAborted } from "$lib/stores/isAborted";
|
|
|
|
| 18 |
|
| 19 |
import NavConversationItem from "./NavConversationItem.svelte";
|
| 20 |
import type { LayoutData } from "../../routes/$types";
|
|
@@ -164,7 +165,7 @@
|
|
| 164 |
<InfiniteScroll onvisible={handleVisible} />
|
| 165 |
{/if}
|
| 166 |
</div>
|
| 167 |
-
<div
|
| 168 |
class="flex touch-none flex-col gap-1 rounded-r-xl border border-l-0 border-gray-100 p-3 text-sm dark:border-transparent md:mt-3 md:bg-gradient-to-l md:from-gray-50 md:dark:from-gray-800/30"
|
| 169 |
>
|
| 170 |
{#if user?.username || user?.email}
|
|
@@ -189,6 +190,15 @@
|
|
| 189 |
</span>
|
| 190 |
{/if}
|
| 191 |
</button>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 192 |
{/if}
|
| 193 |
|
| 194 |
<a
|
|
|
|
| 15 |
import IconMoon from "$lib/components/icons/IconMoon.svelte";
|
| 16 |
import { switchTheme } from "$lib/switchTheme";
|
| 17 |
import { isAborted } from "$lib/stores/isAborted";
|
| 18 |
+
import { loginModalOpen } from "$lib/stores/loginModal";
|
| 19 |
|
| 20 |
import NavConversationItem from "./NavConversationItem.svelte";
|
| 21 |
import type { LayoutData } from "../../routes/$types";
|
|
|
|
| 165 |
<InfiniteScroll onvisible={handleVisible} />
|
| 166 |
{/if}
|
| 167 |
</div>
|
| 168 |
+
<div
|
| 169 |
class="flex touch-none flex-col gap-1 rounded-r-xl border border-l-0 border-gray-100 p-3 text-sm dark:border-transparent md:mt-3 md:bg-gradient-to-l md:from-gray-50 md:dark:from-gray-800/30"
|
| 170 |
>
|
| 171 |
{#if user?.username || user?.email}
|
|
|
|
| 190 |
</span>
|
| 191 |
{/if}
|
| 192 |
</button>
|
| 193 |
+
{:else}
|
| 194 |
+
<button
|
| 195 |
+
onclick={() => {
|
| 196 |
+
$loginModalOpen = true;
|
| 197 |
+
}}
|
| 198 |
+
class="flex h-9 flex-none items-center gap-1.5 rounded-lg pl-2.5 pr-2 text-gray-500 hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-700"
|
| 199 |
+
>
|
| 200 |
+
Login
|
| 201 |
+
</button>
|
| 202 |
{/if}
|
| 203 |
|
| 204 |
<a
|