From 4dff1299491e078aa4cdc8e36d8fcbdc23b31981 Mon Sep 17 00:00:00 2001 From: Alex Date: Sat, 13 May 2023 09:05:30 -0500 Subject: [PATCH] feat(web): Replicate albums view for sharing view (#2433) * replicate album view for sharing view * Remove unused file * fix test * correct title --- .../components/album-page/album-card.svelte | 49 +++++++++--- .../shared-album-list-tile.svelte | 74 ------------------- web/src/routes/(user)/albums/+page.svelte | 6 +- web/src/routes/(user)/sharing/+page.server.ts | 2 +- web/src/routes/(user)/sharing/+page.svelte | 16 ++-- 5 files changed, 53 insertions(+), 94 deletions(-) delete mode 100644 web/src/lib/components/sharing-page/shared-album-list-tile.svelte diff --git a/web/src/lib/components/album-page/album-card.svelte b/web/src/lib/components/album-page/album-card.svelte index e9d9b025a8..b92391067d 100644 --- a/web/src/lib/components/album-page/album-card.svelte +++ b/web/src/lib/components/album-page/album-card.svelte @@ -12,7 +12,7 @@
-
- -
+ {#if !isSharingView} +
+ +
+ {/if}
-
+
@@ -101,9 +115,20 @@ {album.assetCount.toLocaleString($locale)} {album.assetCount == 1 ? `item` : `items`}

+

·

- {#if album.shared} -

·

+ {#if isSharingView} + {#await getAlbumOwnerInfo() then albumOwner} + {#if user.email == albumOwner.email} +

Owned

+ {:else} +

+ Shared by {albumOwner.firstName} + {albumOwner.lastName} +

+ {/if} + {/await} + {:else if album.shared}

Shared

{/if} diff --git a/web/src/lib/components/sharing-page/shared-album-list-tile.svelte b/web/src/lib/components/sharing-page/shared-album-list-tile.svelte deleted file mode 100644 index 6d46780e58..0000000000 --- a/web/src/lib/components/sharing-page/shared-album-list-tile.svelte +++ /dev/null @@ -1,74 +0,0 @@ - - -
-
- {#await loadImageData(album.albumThumbnailAssetId)} -
- ... -
- {:then imageData} - {album.id} - {/await} -
- -
-

- {album.albumName} -

-

{album.assetCount} items

-

·

- {#await getAlbumOwnerInfo() then albumOwner} - {#if user.email == albumOwner.email} -

Owned

- {:else} -

- Shared by {albumOwner.firstName} - {albumOwner.lastName} -

- {/if} - {/await} -
-
-
diff --git a/web/src/routes/(user)/albums/+page.svelte b/web/src/routes/(user)/albums/+page.svelte index e19fd1b930..034063ebf1 100644 --- a/web/src/routes/(user)/albums/+page.svelte +++ b/web/src/routes/(user)/albums/+page.svelte @@ -69,7 +69,11 @@ href={`albums/${album.id}`} animate:flip={{ duration: 200 }} > - showAlbumContextMenu(e.detail, album)} /> + showAlbumContextMenu(e.detail, album)} + user={data.user} + /> {/each}
diff --git a/web/src/routes/(user)/sharing/+page.server.ts b/web/src/routes/(user)/sharing/+page.server.ts index f52be4ba99..6e322e7636 100644 --- a/web/src/routes/(user)/sharing/+page.server.ts +++ b/web/src/routes/(user)/sharing/+page.server.ts @@ -14,7 +14,7 @@ export const load = (async ({ locals: { api, user } }) => { user, sharedAlbums, meta: { - title: 'Albums' + title: 'Sharing' } }; } catch (e) { diff --git a/web/src/routes/(user)/sharing/+page.svelte b/web/src/routes/(user)/sharing/+page.svelte index c70e0994b9..803db5dfe6 100644 --- a/web/src/routes/(user)/sharing/+page.svelte +++ b/web/src/routes/(user)/sharing/+page.svelte @@ -1,7 +1,6 @@