design: show icons by default in navbar

This commit is contained in:
Xylight committed 2025-09-19 16:18:06 -07:00
1 parent a3c417f9cb
commit 252643b5ed
4 files changed
+21 -17

No files matched your search

+1 -1
View File
@@ -61,7 +61,7 @@
style: 'grid-area: sidebar; width: 100% !important;', style: 'grid-area: sidebar; width: 100% !important;',
})} })}
{@render main?.({ {@render main?.({
class: `w-full bg-slate-50 dark:bg-zinc-925 justify-self-center border-x border-slate-200 dark:border-zinc-900 max-lg:pb-22 pb-3 sm:pb-6`, class: `w-full bg-slate-50 dark:bg-zinc-925 justify-self-center border-x border-slate-200 dark:border-zinc-900 max-lg:pb-22 pb-3 lg:pb-6`,
style: 'grid-area: main', style: 'grid-area: main',
})} })}
{@render suffix?.({ {@render suffix?.({
@@ -54,13 +54,16 @@
aria-selected={isSelected} aria-selected={isSelected}
> >
{#snippet prefix()} {#snippet prefix()}
<div class={(icon || customIcon) && adaptive ? 'lg:hidden' : ''}>
{#if icon} {#if icon}
<div class="hidden lg:block">
<Icon src={icon} size="16" micro />
</div>
<div class="block lg:hidden">
<Icon src={icon} size="20" mini /> <Icon src={icon} size="20" mini />
</div>
{:else} {:else}
{@render customIcon?.({ size: 16, isSelected })} {@render customIcon?.({ size: 16, isSelected })}
{/if} {/if}
</div>
{/snippet} {/snippet}
<span class="hidden {adaptive ? 'lg:block' : ''}">{label}</span> <span class="hidden {adaptive ? 'lg:block' : ''}">{label}</span>
{@render children?.()} {@render children?.()}
+10 -14
View File
@@ -1,5 +1,6 @@
<script lang="ts"> <script lang="ts">
import { notifications, profile } from '$lib/auth.svelte.js' import { notifications, profile } from '$lib/auth.svelte.js'
import { site } from '$lib/client/lemmy.svelte'
import { import {
amModOfAny, amModOfAny,
isAdmin, isAdmin,
@@ -7,14 +8,13 @@
import Avatar from '$lib/components/ui/Avatar.svelte' import Avatar from '$lib/components/ui/Avatar.svelte'
import { t } from '$lib/i18n/translations' import { t } from '$lib/i18n/translations'
import { LINKED_INSTANCE_URL } from '$lib/instance.svelte' import { LINKED_INSTANCE_URL } from '$lib/instance.svelte'
import { site } from '$lib/client/lemmy.svelte'
import { Menu, Spinner } from 'mono-svelte' import { Menu, Spinner } from 'mono-svelte'
import { import {
Bars3, Bars3,
GlobeAlt, GlobeAlt,
Icon, Icon,
MagnifyingGlass, MagnifyingGlass,
Plus, PencilSquare,
ServerStack, ServerStack,
ShieldCheck, ShieldCheck,
} from 'svelte-hero-icons' } from 'svelte-hero-icons'
@@ -35,7 +35,9 @@
<CommandsWrapper bind:open={promptOpen} /> <CommandsWrapper bind:open={promptOpen} />
<nav <nav
class={[ class={[
'flex flex-row gap-2 items-center w-full mx-auto z-50 box-border p-0.5 duration-150 @container', 'w-full mx-auto z-50',
'lg:gap-5 gap-2 flex flex-row items-center p-2',
'box-border p-0.5 duration-150 @container',
clazz, clazz,
]} ]}
{style} {style}
@@ -48,7 +50,7 @@
}} }}
href="/" href="/"
label={$t('nav.home')} label={$t('nav.home')}
class="ml-2 lg:ml-2 logo border-0 lg:rounded-full! lg:w-10! lg:h-10 lg:px-0! text-primary-900! dark:text-primary-100!" class="logo border-0 lg:rounded-full! lg:w-10! lg:h-10 lg:px-0! text-primary-900! dark:text-primary-100!"
adaptive={false} adaptive={false}
> >
{#snippet customIcon()} {#snippet customIcon()}
@@ -68,11 +70,7 @@
{/if} {/if}
{/snippet} {/snippet}
</NavButton> </NavButton>
<div <div class="flex-1"></div>
class="flex flex-row gap-2 lg:gap-5 py-2 px-2 items-center w-full overflow-auto"
style="border-radius: inherit;"
>
<div class="ml-auto"></div>
{#if profile.current?.user && isAdmin(profile.current.user)} {#if profile.current?.user && isAdmin(profile.current.user)}
<NavButton <NavButton
href="/admin" href="/admin"
@@ -98,12 +96,11 @@
/> />
<NavButton href="/search" label={$t('nav.search')} icon={MagnifyingGlass} /> <NavButton href="/search" label={$t('nav.search')} icon={MagnifyingGlass} />
<NavButton <NavButton
class="relative"
label={$t('nav.create.label')} label={$t('nav.create.label')}
icon={Plus}
adaptive={false}
color="primary"
href="/create" href="/create"
isSelectedFilter={(path) => path.startsWith('/create')}
icon={PencilSquare}
alwaysShowIcon
/> />
<Menu placement="bottom"> <Menu placement="bottom">
{#snippet target(attachment)} {#snippet target(attachment)}
@@ -148,5 +145,4 @@
{/if} {/if}
{/snippet} {/snippet}
</Menu> </Menu>
</div>
</nav> </nav>
+5
View File
@@ -15,6 +15,11 @@
let { data = $bindable() } = $props() let { data = $bindable() } = $props()
$effect(() => {
if (data.filters.value.sort)
settings.defaultSort.sort = data.filters.value.sort
})
const FeedComponent = $derived( const FeedComponent = $derived(
settings.infiniteScroll && browser && !settings.posts.noVirtualize settings.infiniteScroll && browser && !settings.posts.noVirtualize
? VirtualFeed ? VirtualFeed