mirror of
https://github.com/immich-app/immich.git
synced 2024-12-26 10:50:29 +02:00
fix(web): small fixes for empty placeholder (#7859)
This commit is contained in:
parent
4023c665cc
commit
b7e5407822
@ -1,28 +1,24 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import empty1Url from '$lib/assets/empty-1.svg';
|
import empty1Url from '$lib/assets/empty-1.svg';
|
||||||
|
|
||||||
export let actionHandler: undefined | (() => unknown) = undefined;
|
export let onClick: undefined | (() => unknown) = undefined;
|
||||||
export let text = '';
|
export let text: string;
|
||||||
export let alt = '';
|
|
||||||
export let fullWidth = false;
|
export let fullWidth = false;
|
||||||
export let src = empty1Url;
|
export let src = empty1Url;
|
||||||
|
|
||||||
const noop = () => {};
|
$: width = fullWidth ? 'w-full' : 'w-1/2';
|
||||||
|
|
||||||
$: handler = actionHandler || noop;
|
const hoverClasses = onClick
|
||||||
$: width = fullWidth ? 'w-full' : 'w-[50%]';
|
? `border dark:border-immich-dark-gray hover:bg-immich-primary/5 dark:hover:bg-immich-dark-primary/25`
|
||||||
|
|
||||||
const hoverClasses = actionHandler
|
|
||||||
? `border dark:border-immich-dark-gray hover:bg-immich-primary/5 dark:hover:bg-immich-dark-primary/25 hover:cursor-pointer`
|
|
||||||
: '';
|
: '';
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
||||||
<div
|
<svelte:element
|
||||||
on:click={handler}
|
this={onClick ? 'button' : 'div'}
|
||||||
on:keydown={handler}
|
on:click={onClick}
|
||||||
class="{width} m-auto mt-10 flex flex-col place-content-center place-items-center rounded-3xl bg-gray-50 p-5 dark:bg-immich-dark-gray {hoverClasses}"
|
class="{width} m-auto mt-10 flex flex-col place-content-center place-items-center rounded-3xl bg-gray-50 p-5 dark:bg-immich-dark-gray {hoverClasses}"
|
||||||
>
|
>
|
||||||
<img {src} {alt} width="500" draggable="false" />
|
<img {src} alt="" width="500" draggable="false" />
|
||||||
<p class="text-immich-text-gray-500 text-center dark:text-immich-dark-fg">{text}</p>
|
<p class="text-immich-text-gray-500 dark:text-immich-dark-fg">{text}</p>
|
||||||
</div>
|
</svelte:element>
|
||||||
|
@ -375,11 +375,7 @@
|
|||||||
|
|
||||||
<!-- Empty Message -->
|
<!-- Empty Message -->
|
||||||
{:else}
|
{:else}
|
||||||
<EmptyPlaceholder
|
<EmptyPlaceholder text="Create an album to organize your photos and videos" onClick={handleCreateAlbum} />
|
||||||
text="Create an album to organize your photos and videos"
|
|
||||||
actionHandler={handleCreateAlbum}
|
|
||||||
alt="Empty albums"
|
|
||||||
/>
|
|
||||||
{/if}
|
{/if}
|
||||||
</UserPageLayout>
|
</UserPageLayout>
|
||||||
|
|
||||||
|
@ -45,10 +45,6 @@
|
|||||||
|
|
||||||
<UserPageLayout hideNavbar={$isMultiSelectState} title={data.meta.title} scrollbar={false}>
|
<UserPageLayout 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" slot="empty" />
|
||||||
text="Archive photos and videos to hide them from your Photos view"
|
|
||||||
alt="Empty archive"
|
|
||||||
slot="empty"
|
|
||||||
/>
|
|
||||||
</AssetGrid>
|
</AssetGrid>
|
||||||
</UserPageLayout>
|
</UserPageLayout>
|
||||||
|
@ -50,10 +50,6 @@
|
|||||||
|
|
||||||
<UserPageLayout hideNavbar={$isMultiSelectState} title={data.meta.title} scrollbar={false}>
|
<UserPageLayout 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" slot="empty" />
|
||||||
text="Add favorites to quickly find your best pictures and videos"
|
|
||||||
alt="Empty favorites"
|
|
||||||
slot="empty"
|
|
||||||
/>
|
|
||||||
</AssetGrid>
|
</AssetGrid>
|
||||||
</UserPageLayout>
|
</UserPageLayout>
|
||||||
|
@ -88,10 +88,6 @@
|
|||||||
{#if $user.memoriesEnabled}
|
{#if $user.memoriesEnabled}
|
||||||
<MemoryLane />
|
<MemoryLane />
|
||||||
{/if}
|
{/if}
|
||||||
<EmptyPlaceholder
|
<EmptyPlaceholder text="CLICK TO UPLOAD YOUR FIRST PHOTO" onClick={() => openFileUploadDialog()} slot="empty" />
|
||||||
text="CLICK TO UPLOAD YOUR FIRST PHOTO"
|
|
||||||
actionHandler={() => openFileUploadDialog()}
|
|
||||||
slot="empty"
|
|
||||||
/>
|
|
||||||
</AssetGrid>
|
</AssetGrid>
|
||||||
</UserPageLayout>
|
</UserPageLayout>
|
||||||
|
@ -92,7 +92,6 @@
|
|||||||
{#if data.sharedAlbums.length === 0}
|
{#if data.sharedAlbums.length === 0}
|
||||||
<EmptyPlaceholder
|
<EmptyPlaceholder
|
||||||
text="Create a shared album to share photos and videos with people in your network"
|
text="Create a shared album to share photos and videos with people in your network"
|
||||||
alt="Empty album list"
|
|
||||||
src={empty2Url}
|
src={empty2Url}
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
|
@ -91,12 +91,7 @@
|
|||||||
<p class="font-medium text-gray-500/60 dark:text-gray-300/60 p-4">
|
<p class="font-medium text-gray-500/60 dark:text-gray-300/60 p-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 text="Trashed photos and videos will show up here." src={empty3Url} slot="empty" />
|
||||||
text="Trashed photos and videos will show up here."
|
|
||||||
alt="Empty trash can"
|
|
||||||
slot="empty"
|
|
||||||
src={empty3Url}
|
|
||||||
/>
|
|
||||||
</AssetGrid>
|
</AssetGrid>
|
||||||
</UserPageLayout>
|
</UserPageLayout>
|
||||||
{/if}
|
{/if}
|
||||||
|
@ -462,8 +462,7 @@
|
|||||||
{:else}
|
{:else}
|
||||||
<EmptyPlaceholder
|
<EmptyPlaceholder
|
||||||
text="Create an external library to view your photos and videos"
|
text="Create an external library to view your photos and videos"
|
||||||
actionHandler={() => (toCreateLibrary = true)}
|
onClick={() => (toCreateLibrary = true)}
|
||||||
alt="Empty albums"
|
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
@ -203,12 +203,7 @@
|
|||||||
<section class="w-full pb-28 sm:w-5/6 md:w-[850px]">
|
<section class="w-full pb-28 sm:w-5/6 md:w-[850px]">
|
||||||
{#if matches.length + extras.length + orphans.length === 0}
|
{#if matches.length + extras.length + orphans.length === 0}
|
||||||
<div class="w-full">
|
<div class="w-full">
|
||||||
<EmptyPlaceholder
|
<EmptyPlaceholder fullWidth text="Untracked and missing files will show up here" src={empty4Url} />
|
||||||
fullWidth
|
|
||||||
text="Untracked and missing files will show up here"
|
|
||||||
alt="Empty report"
|
|
||||||
src={empty4Url}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
{:else}
|
{:else}
|
||||||
<div class="gap-2">
|
<div class="gap-2">
|
||||||
|
Loading…
Reference in New Issue
Block a user