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 icon: IconSource | undefined = undefined
export let href: string | 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> </script>
<Button <Button
+15 -14
View File
@@ -147,6 +147,21 @@
</div> </div>
{/if} {/if}
<div class="ml-auto" /> <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)} {#if amModOfAny($profile?.user)}
<NavButton href="/moderation" label="Moderation" class="relative"> <NavButton href="/moderation" label="Moderation" class="relative">
{#if ($profile?.user?.notifications.reports ?? 0) > 0} {#if ($profile?.user?.notifications.reports ?? 0) > 0}
@@ -158,20 +173,6 @@
</NavButton> </NavButton>
{/if} {/if}
<NavButton href="/communities" label="Explore" icon={GlobeAlt} /> <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 <NavButton
on:click={() => (searching = true)} on:click={() => (searching = true)}
label="Search" label="Search"
+2 -2
View File
@@ -92,8 +92,8 @@ export const defaultSettings: Settings = {
comments: env.PUBLIC_DEFAULT_COMMENT_SORT ?? ('Hot' as any), comments: env.PUBLIC_DEFAULT_COMMENT_SORT ?? ('Hot' as any),
}, },
hidePosts: { hidePosts: {
deleted: toBool(env.PUBLIC_HIDE_DELETED) ?? false, deleted: toBool(env.PUBLIC_HIDE_DELETED) ?? true,
removed: toBool(env.PUBLIC_HIDE_REMOVED) ?? false, removed: toBool(env.PUBLIC_HIDE_REMOVED) ?? true,
}, },
expandSidebar: toBool(env.PUBLIC_EXPAND_SIDEBAR) ?? true, expandSidebar: toBool(env.PUBLIC_EXPAND_SIDEBAR) ?? true,
expandCommunities: toBool(env.PUBLIC_EXPAND_COMMUNITIES) ?? true, expandCommunities: toBool(env.PUBLIC_EXPAND_COMMUNITIES) ?? true,
+5 -7
View File
@@ -235,13 +235,11 @@
</Link> </Link>
</p> </p>
</span> </span>
<div class="flex flex-row items-center gap-4 flex-wrap"> <div class="flex flex-col items-start gap-4 flex-wrap">
<Checkbox bind:checked={$userSettings.hidePosts.deleted}> <Switch bind:checked={$userSettings.hidePosts.deleted}>Deleted</Switch>
Deleted <Switch bind:checked={$userSettings.hidePosts.removed}>
</Checkbox> Removed by Moderator
<Checkbox bind:checked={$userSettings.hidePosts.removed}> </Switch>
Removed
</Checkbox>
</div> </div>
</Setting> </Setting>
<ToggleSetting <ToggleSetting