fix: admin button order
This commit is contained in:
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
|
||||
|
||||
@@ -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"
|
||||
|
||||
+2
-2
@@ -92,8 +92,8 @@ export const defaultSettings: Settings = {
|
||||
comments: env.PUBLIC_DEFAULT_COMMENT_SORT ?? ('Hot' as any),
|
||||
},
|
||||
hidePosts: {
|
||||
deleted: toBool(env.PUBLIC_HIDE_DELETED) ?? false,
|
||||
removed: toBool(env.PUBLIC_HIDE_REMOVED) ?? false,
|
||||
deleted: toBool(env.PUBLIC_HIDE_DELETED) ?? true,
|
||||
removed: toBool(env.PUBLIC_HIDE_REMOVED) ?? true,
|
||||
},
|
||||
expandSidebar: toBool(env.PUBLIC_EXPAND_SIDEBAR) ?? true,
|
||||
expandCommunities: toBool(env.PUBLIC_EXPAND_COMMUNITIES) ?? true,
|
||||
|
||||
@@ -235,13 +235,11 @@
|
||||
</Link>
|
||||
</p>
|
||||
</span>
|
||||
<div class="flex flex-row items-center gap-4 flex-wrap">
|
||||
<Checkbox bind:checked={$userSettings.hidePosts.deleted}>
|
||||
Deleted
|
||||
</Checkbox>
|
||||
<Checkbox bind:checked={$userSettings.hidePosts.removed}>
|
||||
Removed
|
||||
</Checkbox>
|
||||
<div class="flex flex-col items-start gap-4 flex-wrap">
|
||||
<Switch bind:checked={$userSettings.hidePosts.deleted}>Deleted</Switch>
|
||||
<Switch bind:checked={$userSettings.hidePosts.removed}>
|
||||
Removed by Moderator
|
||||
</Switch>
|
||||
</div>
|
||||
</Setting>
|
||||
<ToggleSetting
|
||||
|
||||
Reference in new issue
Block a user