fix(web): scrollbar offset (#4518)

* fix(web): scrollbar offset

* fix offset on photo page

* proper fix

---------

Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
Jason Rasmussen 2023-10-18 11:54:20 -04:00 committed by GitHub
parent 335216f6dd
commit f4a12acd29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 50 additions and 52 deletions

View File

@ -13,6 +13,7 @@
export let admin = false; export let admin = false;
$: scrollbarClass = scrollbar ? 'immich-scrollbar p-4 pb-8' : 'scrollbar-hidden pl-4'; $: scrollbarClass = scrollbar ? 'immich-scrollbar p-4 pb-8' : 'scrollbar-hidden pl-4';
$: hasTitleClass = title ? 'top-16 h-[calc(100%-theme(spacing.16))]' : 'top-0 h-full';
</script> </script>
<header> <header>
@ -32,20 +33,19 @@
<SideBar /> <SideBar />
{/if} {/if}
</slot> </slot>
<slot name="content">
{#if title}
<section class="relative"> <section class="relative">
{#if title}
<div <div
class="absolute flex h-16 w-full place-items-center justify-between border-b p-4 dark:border-immich-dark-gray dark:text-immich-dark-fg" class="absolute flex h-16 w-full place-items-center justify-between border-b p-4 dark:border-immich-dark-gray dark:text-immich-dark-fg"
> >
<p class="font-medium">{title}</p> <p class="font-medium">{title}</p>
<slot name="buttons" /> <slot name="buttons" />
</div> </div>
{/if}
<div class="{scrollbarClass} absolute top-16 h-[calc(100%-theme(spacing.16))] w-full overflow-y-auto"> <div class="{scrollbarClass} absolute {hasTitleClass} w-full overflow-y-auto">
<slot /> <slot />
</div> </div>
</section> </section>
{/if}
</slot>
</main> </main>

View File

@ -25,6 +25,7 @@
export let assetStore: AssetStore; export let assetStore: AssetStore;
export let assetInteractionStore: AssetInteractionStore; export let assetInteractionStore: AssetInteractionStore;
export let removeAction: AssetAction | null = null; export let removeAction: AssetAction | null = null;
$: isTrashEnabled = $featureFlags.loaded && $featureFlags.trash; $: isTrashEnabled = $featureFlags.loaded && $featureFlags.trash;
export let forceDelete = false; export let forceDelete = false;

View File

@ -45,7 +45,7 @@
</AssetSelectControlBar> </AssetSelectControlBar>
{/if} {/if}
<UserPageLayout user={data.user} hideNavbar={$isMultiSelectState} title={data.meta.title}> <UserPageLayout user={data.user} hideNavbar={$isMultiSelectState} title={data.meta.title} scrollbar={false}>
<AssetGrid {assetStore} {assetInteractionStore} removeAction={AssetAction.UNARCHIVE}> <AssetGrid {assetStore} {assetInteractionStore} removeAction={AssetAction.UNARCHIVE}>
<EmptyPlaceholder <EmptyPlaceholder
text="Archive photos and videos to hide them from your Photos view" text="Archive photos and videos to hide them from your Photos view"

View File

@ -46,7 +46,7 @@
</AssetSelectControlBar> </AssetSelectControlBar>
{/if} {/if}
<UserPageLayout user={data.user} hideNavbar={$isMultiSelectState} title={data.meta.title}> <UserPageLayout user={data.user} hideNavbar={$isMultiSelectState} title={data.meta.title} scrollbar={false}>
<AssetGrid {assetStore} {assetInteractionStore} removeAction={AssetAction.UNFAVORITE}> <AssetGrid {assetStore} {assetInteractionStore} removeAction={AssetAction.UNFAVORITE}>
<EmptyPlaceholder <EmptyPlaceholder
text="Add favorites to quickly find your best pictures and videos" text="Add favorites to quickly find your best pictures and videos"

View File

@ -48,8 +48,6 @@
}; };
</script> </script>
<UserPageLayout user={data.user} hideNavbar={$isMultiSelectState} showUploadButton>
<svelte:fragment slot="header">
{#if $isMultiSelectState} {#if $isMultiSelectState}
<AssetSelectControlBar assets={$selectedAssets} clearSelect={() => assetInteractionStore.clearMultiselect()}> <AssetSelectControlBar assets={$selectedAssets} clearSelect={() => assetInteractionStore.clearMultiselect()}>
<CreateSharedLink on:escape={() => (handleEscapeKey = true)} /> <CreateSharedLink on:escape={() => (handleEscapeKey = true)} />
@ -70,8 +68,8 @@
</AssetSelectContextMenu> </AssetSelectContextMenu>
</AssetSelectControlBar> </AssetSelectControlBar>
{/if} {/if}
</svelte:fragment>
<svelte:fragment slot="content"> <UserPageLayout user={data.user} hideNavbar={$isMultiSelectState} showUploadButton scrollbar={false}>
<AssetGrid {assetStore} {assetInteractionStore} removeAction={AssetAction.ARCHIVE} on:escape={handleEscape}> <AssetGrid {assetStore} {assetInteractionStore} removeAction={AssetAction.ARCHIVE} on:escape={handleEscape}>
{#if data.user.memoriesEnabled} {#if data.user.memoriesEnabled}
<MemoryLane /> <MemoryLane />
@ -82,5 +80,4 @@
slot="empty" slot="empty"
/> />
</AssetGrid> </AssetGrid>
</svelte:fragment>
</UserPageLayout> </UserPageLayout>

View File

@ -70,7 +70,7 @@
{/if} {/if}
{#if $featureFlags.loaded && $featureFlags.trash} {#if $featureFlags.loaded && $featureFlags.trash}
<UserPageLayout user={data.user} hideNavbar={$isMultiSelectState} title={data.meta.title}> <UserPageLayout user={data.user} hideNavbar={$isMultiSelectState} title={data.meta.title} scrollbar={false}>
<div class="flex place-items-center gap-2" slot="buttons"> <div class="flex place-items-center gap-2" slot="buttons">
<LinkButton on:click={handleRestoreTrash}> <LinkButton on:click={handleRestoreTrash}>
<div class="flex place-items-center gap-2 text-sm"> <div class="flex place-items-center gap-2 text-sm">
@ -87,7 +87,7 @@
</div> </div>
<AssetGrid forceDelete {assetStore} {assetInteractionStore}> <AssetGrid forceDelete {assetStore} {assetInteractionStore}>
<p class="font-medium text-gray-500/60 dark:text-gray-300/60"> <p class="font-medium text-gray-500/60 dark:text-gray-300/60 py-4">
Trashed items will be permanently deleted after {$serverConfig.trashDays} days. Trashed items will be permanently deleted after {$serverConfig.trashDays} days.
</p> </p>
<EmptyPlaceholder <EmptyPlaceholder