mirror of
https://github.com/immich-app/immich.git
synced 2025-12-23 01:11:36 +03:00
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:
@@ -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>
|
||||
Reference in New Issue
Block a user