From d05b77a9c70ef1c7c2d3dc530d42c5cc43739245 Mon Sep 17 00:00:00 2001 From: Xylight Date: Sun, 4 Aug 2024 19:45:45 -0700 Subject: [PATCH] feat: allow collapsing accounts --- .../ui/sidebar/ProfileButton.svelte | 1 - src/lib/components/ui/sidebar/Sidebar.svelte | 30 ++++++++++++++----- .../ui/sidebar/SidebarButton.svelte | 8 ++--- src/lib/settings.ts | 2 ++ 4 files changed, 26 insertions(+), 15 deletions(-) diff --git a/src/lib/components/ui/sidebar/ProfileButton.svelte b/src/lib/components/ui/sidebar/ProfileButton.svelte index 08170434..99215213 100644 --- a/src/lib/components/ui/sidebar/ProfileButton.svelte +++ b/src/lib/components/ui/sidebar/ProfileButton.svelte @@ -43,7 +43,6 @@ {index} {guest} selected={$profile?.id == prof.id} - slot="icon" /> - {#each [...$profileData.profiles] as prof, index (prof.id)} -
- -
- {/each} - - {$t('account.accounts')} - + + + + + {$t('account.accounts')} + + {$profileData.profiles.length} + + + + {#each [...$profileData.profiles] as prof, index (prof.id)} +
+ +
+ {/each} + + {$t('account.accounts')} + +
{/if}
{#if $profile?.favorites && $profile?.favorites.length > 0} diff --git a/src/lib/components/ui/sidebar/SidebarButton.svelte b/src/lib/components/ui/sidebar/SidebarButton.svelte index 9ad70bc2..d8620e9c 100644 --- a/src/lib/components/ui/sidebar/SidebarButton.svelte +++ b/src/lib/components/ui/sidebar/SidebarButton.svelte @@ -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} -
+
diff --git a/src/lib/settings.ts b/src/lib/settings.ts index 4fbf2759..17ac91b3 100644 --- a/src/lib/settings.ts +++ b/src/lib/settings.ts @@ -55,6 +55,7 @@ interface Settings { about: boolean stats: boolean team: boolean + accounts: boolean } displayNames: boolean nsfwBlur: boolean @@ -128,6 +129,7 @@ export const defaultSettings: Settings = { about: false, stats: false, team: false, + accounts: false, }, displayNames: toBool(env.PUBLIC_DISPLAY_NAMES) ?? true, nsfwBlur: toBool(env.PUBLIC_NSFW_BLUR) ?? true,