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}
{guest}
selected={$profile?.id == prof.id}
slot="icon"
/>
<span
class="inline-flex flex-col gap-0 {$profile?.id == prof.id
+22 -8
View File
@@ -108,14 +108,28 @@
{/if}
{#if $profileData.profiles.length >= 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">
<ProfileButton {index} {prof} />
</div>
{/each}
<SidebarButton href="/accounts" icon={UserGroup}>
<span slot="label">{$t('account.accounts')}</span>
</SidebarButton>
<Expandable
class="max-w-full min-w-0 w-full"
bind:open={$userSettings.expand.accounts}
>
<span slot="title" class="px-2 py-1 w-full">
<EndPlaceholder>
{$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}
<hr class="border-slate-200 dark:border-zinc-900 my-1" />
{#if $profile?.favorites && $profile?.favorites.length > 0}
@@ -21,7 +21,7 @@
{href}
on:click
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-slate-600 dark:text-zinc-400'} {$$props.class}"
>
@@ -31,11 +31,7 @@
{/if}
</slot>
<slot />
<div
class="{$userSettings.expandSidebar
? 'contents'
: '//max-lg:hidden'} contents"
>
<div class="contents">
<slot name="label" />
</div>
</Button>