feat(web): improve shared link management on mobile (#11720)

* feat(web): improve shared link management on mobile

* fix format
This commit is contained in:
Michel Heusschen 2024-08-13 16:37:47 +02:00 committed by GitHub
parent 9837d60074
commit 276101ee82
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 174 additions and 121 deletions

View file

@ -19,7 +19,7 @@ describe('AlbumCover component', () => {
const img = component.getByTestId('album-image') as HTMLImageElement;
expect(img.alt).toBe('someName');
expect(img.getAttribute('loading')).toBe('lazy');
expect(img.className).toBe('z-0 rounded-xl object-cover text');
expect(img.className).toBe('z-0 rounded-xl object-cover aspect-square text');
expect(img.getAttribute('src')).toBe('/asdf');
expect(getAssetThumbnailUrl).toHaveBeenCalledWith({ id: '123' });
});
@ -36,7 +36,7 @@ describe('AlbumCover component', () => {
const img = component.getByTestId('album-image') as HTMLImageElement;
expect(img.alt).toBe('unnamed_album');
expect(img.getAttribute('loading')).toBe('eager');
expect(img.className).toBe('z-0 rounded-xl object-cover asdf');
expect(img.className).toBe('z-0 rounded-xl object-cover aspect-square asdf');
expect(img.getAttribute('src')).toStrictEqual(expect.any(String));
});
});

View file

@ -14,10 +14,8 @@
$: thumbnailUrl = album.albumThumbnailAssetId ? getAssetThumbnailUrl({ id: album.albumThumbnailAssetId }) : null;
</script>
<div class="relative aspect-square">
{#if thumbnailUrl}
<AssetCover {alt} class={className} src={thumbnailUrl} {preload} />
{:else}
<NoCover {alt} class={className} {preload} />
{/if}
</div>
{#if thumbnailUrl}
<AssetCover {alt} class={className} src={thumbnailUrl} {preload} />
{:else}
<NoCover {alt} class={className} {preload} />
{/if}