feat(web): add cover images to individual shares (#9988)

* feat(web): add cover images to individual shares

* Update wording in share modal

* Use translation function

* Add and use new translations

* Fix formatting

* Update with suggestions

* Update test language

* Update test and language file per suggestions

* Fix formatting

* Remove unused translation
This commit is contained in:
Snowknight26
2024-06-14 18:16:48 -05:00
committed by GitHub
parent 78f600ebce
commit aea1c46bea
13 changed files with 214 additions and 30 deletions

View File

@@ -0,0 +1,28 @@
<script lang="ts">
import type { SharedLinkResponseDto } from '@immich/sdk';
import AlbumCover from '$lib/components/album-page/album-cover.svelte';
import NoCover from '$lib/components/sharedlinks-page/covers/no-cover.svelte';
import AssetCover from '$lib/components/sharedlinks-page/covers/asset-cover.svelte';
import { getAssetThumbnailUrl } from '$lib/utils';
import { t } from 'svelte-i18n';
export let link: SharedLinkResponseDto;
export let preload = false;
let className = '';
export { className as class };
</script>
<div class="relative aspect-square">
{#if link?.album}
<AlbumCover album={link.album} class={className} {preload} />
{:else if link.assets[0]}
<AssetCover
alt={$t('individual_share')}
class={className}
{preload}
src={getAssetThumbnailUrl(link.assets[0].id)}
/>
{:else}
<NoCover alt={$t('unnamed_share')} class={className} {preload} />
{/if}
</div>