0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-01-21 00:52:43 -05:00

feat(web): added toggle for Sharing button in the sidebar (#4674)

* Added toggle for Sharing button in the sidebar

* fix: format

---------

Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
doggo 2023-10-29 01:42:51 +00:00 committed by GitHub
parent 8a6889529c
commit daad02504f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 17 deletions

View file

@ -77,23 +77,25 @@
<SideBarButton title="People" icon={mdiAccount} isSelected={$page.route.id === '/(user)/people'} /> <SideBarButton title="People" icon={mdiAccount} isSelected={$page.route.id === '/(user)/people'} />
</a> </a>
{/if} {/if}
<a data-sveltekit-preload-data="hover" href={AppRoute.SHARING} draggable="false"> {#if $sidebarSettings.sharing}
<SideBarButton <a data-sveltekit-preload-data="hover" href={AppRoute.SHARING} draggable="false">
title="Sharing" <SideBarButton
icon={isSharingSelected ? mdiAccountMultiple : mdiAccountMultipleOutline} title="Sharing"
isSelected={isSharingSelected} icon={isSharingSelected ? mdiAccountMultiple : mdiAccountMultipleOutline}
> isSelected={isSharingSelected}
<svelte:fragment slot="moreInformation"> >
{#await getAlbumCount()} <svelte:fragment slot="moreInformation">
<LoadingSpinner /> {#await getAlbumCount()}
{:then data} <LoadingSpinner />
<div> {:then data}
<p>{data.shared.toLocaleString($locale)} Albums</p> <div>
</div> <p>{data.shared.toLocaleString($locale)} Albums</p>
{/await} </div>
</svelte:fragment> {/await}
</SideBarButton> </svelte:fragment>
</a> </SideBarButton>
</a>
{/if}
<div class="text-xs transition-all duration-200 dark:text-immich-dark-fg"> <div class="text-xs transition-all duration-200 dark:text-immich-dark-fg">
<p class="hidden p-6 group-hover:sm:block md:block">LIBRARY</p> <p class="hidden p-6 group-hover:sm:block md:block">LIBRARY</p>

View file

@ -10,6 +10,9 @@
<div class="ml-4"> <div class="ml-4">
<SettingSwitch title="People" subtitle="Display a link to People" bind:checked={$sidebarSettings.people} /> <SettingSwitch title="People" subtitle="Display a link to People" bind:checked={$sidebarSettings.people} />
</div> </div>
<div class="ml-4">
<SettingSwitch title="Sharing" subtitle="Display a link to Sharing" bind:checked={$sidebarSettings.sharing} />
</div>
</div> </div>
</div> </div>
</section> </section>

View file

@ -49,10 +49,12 @@ export interface AlbumViewSettings {
export interface SidebarSettings { export interface SidebarSettings {
people: boolean; people: boolean;
sharing: boolean;
} }
export const sidebarSettings = persisted<SidebarSettings>('sidebar-settings', { export const sidebarSettings = persisted<SidebarSettings>('sidebar-settings', {
people: false, people: false,
sharing: true,
}); });
export enum AlbumViewMode { export enum AlbumViewMode {