fix: admin button order

This commit is contained in:
Xylight committed 2024-04-29 18:24:34 -07:00
1 parent 29432e0e15
commit dea195d2cb
4 files changed
+26 -24

No files matched your search

@@ -7,7 +7,10 @@
export let icon: IconSource | undefined = undefined
export let href: string | undefined = undefined
$: isSelected = href != undefined && $page.url.pathname == href
export let isSelectedFilter: (path: string) => boolean = (path) =>
href != undefined && path == href
$: isSelected = isSelectedFilter($page.url.pathname)
</script>
<Button
+15 -14
View File
@@ -147,6 +147,21 @@
</div>
{/if}
<div class="ml-auto" />
{#if $profile?.user && isAdmin($profile.user)}
<NavButton
href="/admin"
label="Admin"
icon={ServerStack}
class="relative"
isSelectedFilter={(path) => path.startsWith('/admin')}
>
{#if ($profile?.user?.notifications.applications ?? 0) > 0}
<div
class="rounded-full w-2 h-2 bg-red-500 absolute -top-1 -left-1"
/>
{/if}
</NavButton>
{/if}
{#if amModOfAny($profile?.user)}
<NavButton href="/moderation" label="Moderation" class="relative">
{#if ($profile?.user?.notifications.reports ?? 0) > 0}
@@ -158,20 +173,6 @@
</NavButton>
{/if}
<NavButton href="/communities" label="Explore" icon={GlobeAlt} />
{#if $profile?.user && isAdmin($profile.user)}
<NavButton
href="/admin"
label="Admin"
icon={ServerStack}
class="relative"
>
{#if ($profile?.user?.notifications.applications ?? 0) > 0}
<div
class="rounded-full w-2 h-2 bg-red-500 absolute -top-1 -left-1"
/>
{/if}
</NavButton>
{/if}
<NavButton
on:click={() => (searching = true)}
label="Search"