feat: allow collapsing accounts

This commit is contained in:
Xylight committed 2024-08-04 19:45:45 -07:00
1 parent 8a192de8e1
commit d05b77a9c7
4 files changed
+26 -15

No files matched your search

@@ -43,7 +43,6 @@
{index} {index}
{guest} {guest}
selected={$profile?.id == prof.id} selected={$profile?.id == prof.id}
slot="icon"
/> />
<span <span
class="inline-flex flex-col gap-0 {$profile?.id == prof.id class="inline-flex flex-col gap-0 {$profile?.id == prof.id
+22 -8
View File
@@ -108,14 +108,28 @@
{/if} {/if}
{#if $profileData.profiles.length >= 1} {#if $profileData.profiles.length >= 1}
<hr class="border-slate-200 dark:border-zinc-900 my-1" /> <hr class="border-slate-200 dark:border-zinc-900 my-1" />
{#each [...$profileData.profiles] as prof, index (prof.id)}
<div animate:flip={{ duration: 300, easing: expoOut }} class="w-full"> <Expandable
<ProfileButton {index} {prof} /> class="max-w-full min-w-0 w-full"
</div> bind:open={$userSettings.expand.accounts}
{/each} >
<SidebarButton href="/accounts" icon={UserGroup}> <span slot="title" class="px-2 py-1 w-full">
<span slot="label">{$t('account.accounts')}</span> <EndPlaceholder>
</SidebarButton> {$t('account.accounts')}
<span slot="action" class="dark:text-white text-black">
{$profileData.profiles.length}
</span>
</EndPlaceholder>
</span>
{#each [...$profileData.profiles] as prof, index (prof.id)}
<div animate:flip={{ duration: 300, easing: expoOut }} class="w-full">
<ProfileButton {index} {prof} />
</div>
{/each}
<SidebarButton href="/accounts" icon={UserGroup}>
{$t('account.accounts')}
</SidebarButton>
</Expandable>
{/if} {/if}
<hr class="border-slate-200 dark:border-zinc-900 my-1" /> <hr class="border-slate-200 dark:border-zinc-900 my-1" />
{#if $profile?.favorites && $profile?.favorites.length > 0} {#if $profile?.favorites && $profile?.favorites.length > 0}
@@ -21,7 +21,7 @@
{href} {href}
on:click on:click
on:contextmenu on:contextmenu
class="font-normal {selected class="font-normal block {selected
? 'text-primary-900 dark:!text-primary-100 bg-slate-100 dark:bg-zinc-800' ? 'text-primary-900 dark:!text-primary-100 bg-slate-100 dark:bg-zinc-800'
: 'text-slate-600 dark:text-zinc-400'} {$$props.class}" : 'text-slate-600 dark:text-zinc-400'} {$$props.class}"
> >
@@ -31,11 +31,7 @@
{/if} {/if}
</slot> </slot>
<slot /> <slot />
<div <div class="contents">
class="{$userSettings.expandSidebar
? 'contents'
: '//max-lg:hidden'} contents"
>
<slot name="label" /> <slot name="label" />
</div> </div>
</Button> </Button>
+2
View File
@@ -55,6 +55,7 @@ interface Settings {
about: boolean about: boolean
stats: boolean stats: boolean
team: boolean team: boolean
accounts: boolean
} }
displayNames: boolean displayNames: boolean
nsfwBlur: boolean nsfwBlur: boolean
@@ -128,6 +129,7 @@ export const defaultSettings: Settings = {
about: false, about: false,
stats: false, stats: false,
team: false, team: false,
accounts: false,
}, },
displayNames: toBool(env.PUBLIC_DISPLAY_NAMES) ?? true, displayNames: toBool(env.PUBLIC_DISPLAY_NAMES) ?? true,
nsfwBlur: toBool(env.PUBLIC_NSFW_BLUR) ?? true, nsfwBlur: toBool(env.PUBLIC_NSFW_BLUR) ?? true,