mirror of
https://github.com/immich-app/immich.git
synced 2025-05-24 01:12:58 -04:00
fix(web): small fixes for album selection modal (#2527)
This commit is contained in:
parent
99b018cd49
commit
50b649cd3e
@ -27,15 +27,16 @@
|
|||||||
on:click={() => dispatcher('album')}
|
on:click={() => dispatcher('album')}
|
||||||
class="w-full flex gap-4 px-6 py-2 hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors"
|
class="w-full flex gap-4 px-6 py-2 hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors"
|
||||||
>
|
>
|
||||||
<div class="h-12 w-12">
|
<div class="h-12 w-12 rounded-xl bg-slate-300">
|
||||||
|
{#if album.albumThumbnailAssetId}
|
||||||
<img
|
<img
|
||||||
src={album.albumThumbnailAssetId &&
|
src={api.getAssetThumbnailUrl(album.albumThumbnailAssetId, ThumbnailFormat.Webp)}
|
||||||
api.getAssetThumbnailUrl(album.albumThumbnailAssetId, ThumbnailFormat.Webp)}
|
|
||||||
alt={album.albumName}
|
alt={album.albumName}
|
||||||
class={`object-cover h-full w-full transition-all z-0 rounded-xl duration-300 hover:shadow-lg`}
|
class={`object-cover h-full w-full transition-all z-0 rounded-xl duration-300 hover:shadow-lg`}
|
||||||
data-testid="album-image"
|
data-testid="album-image"
|
||||||
draggable="false"
|
draggable="false"
|
||||||
/>
|
/>
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
<div class="h-12 flex flex-col items-start justify-center">
|
<div class="h-12 flex flex-col items-start justify-center">
|
||||||
<span>{albumNameArray[0]}<b>{albumNameArray[1]}</b>{albumNameArray[2]}</span>
|
<span>{albumNameArray[0]}<b>{albumNameArray[1]}</b>{albumNameArray[2]}</span>
|
||||||
|
@ -16,18 +16,10 @@
|
|||||||
export let shared: boolean;
|
export let shared: boolean;
|
||||||
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
loading = true;
|
const { data } = await api.albumApi.getAllAlbums(shared || undefined);
|
||||||
|
|
||||||
const { data } = await api.albumApi.getAllAlbums();
|
|
||||||
|
|
||||||
if (shared) {
|
|
||||||
albums = data.filter((album) => album.shared === shared);
|
|
||||||
} else {
|
|
||||||
albums = data;
|
albums = data;
|
||||||
}
|
|
||||||
|
|
||||||
recentAlbums = albums
|
recentAlbums = albums
|
||||||
.filter((album) => album.shared === shared)
|
|
||||||
.sort((a, b) => (new Date(a.createdAt) > new Date(b.createdAt) ? -1 : 1))
|
.sort((a, b) => (new Date(a.createdAt) > new Date(b.createdAt) ? -1 : 1))
|
||||||
.slice(0, 3);
|
.slice(0, 3);
|
||||||
|
|
||||||
@ -61,7 +53,7 @@
|
|||||||
<svelte:fragment slot="title">
|
<svelte:fragment slot="title">
|
||||||
<span class="flex gap-2 place-items-center">
|
<span class="flex gap-2 place-items-center">
|
||||||
<p class="font-medium">
|
<p class="font-medium">
|
||||||
Add to {#if shared}shared {/if}
|
Add to {#if shared}Shared {/if} Album
|
||||||
</p>
|
</p>
|
||||||
</span>
|
</span>
|
||||||
</svelte:fragment>
|
</svelte:fragment>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user