From 8faab62fda5bc4095f77d56b766137310b4dbace Mon Sep 17 00:00:00 2001 From: amendelsohn Date: Thu, 9 May 2024 16:58:34 -0700 Subject: [PATCH 1/3] clean up skeletons for collection page --- .../collection/desktop/CollectionHeader.tsx | 181 ++++++++++-------- .../components/tracks-table/TracksTable.tsx | 1 + .../components/desktop/CollectionPage.tsx | 21 +- 3 files changed, 119 insertions(+), 84 deletions(-) diff --git a/packages/web/src/components/collection/desktop/CollectionHeader.tsx b/packages/web/src/components/collection/desktop/CollectionHeader.tsx index 702e6660318..99b4c400820 100644 --- a/packages/web/src/components/collection/desktop/CollectionHeader.tsx +++ b/packages/web/src/components/collection/desktop/CollectionHeader.tsx @@ -100,7 +100,6 @@ export const CollectionHeader = (props: CollectionHeaderProps) => { type, title, coverArtSizes, - artistName, description, isOwner, releaseDate, @@ -161,7 +160,7 @@ export const CollectionHeader = (props: CollectionHeaderProps) => { }, [onOpen, collectionId]) const renderStatsRow = (isLoading: boolean) => { - if (isLoading) return null + if (isLoading) return return ( { } const isLoading = !isSsrEnabled && (loading || artworkLoading) + // const isLoading = true + // const title = null const fadeIn = { [styles.show]: !isLoading, @@ -185,35 +186,41 @@ export const CollectionHeader = (props: CollectionHeaderProps) => { const topSection = ( - {coverArtSizes || gradient || icon ? ( - - ) : null} - + + - - {!isPublished ? ( - - ) : null} - {isPremium ? : null} - - {isPremium ? `${messages.premiumLabel} ` : ''} - {type === 'playlist' && !isPublished - ? messages.hiddenPlaylistLabel - : type} - - + {isLoading ? ( + + ) : ( + + {!isPublished ? ( + + ) : null} + {isPremium ? : null} + + {isPremium ? `${messages.premiumLabel} ` : ''} + {type === 'playlist' && !isPublished + ? messages.hiddenPlaylistLabel + : type} + + + )} { })} onClick={isOwner ? handleClickEditTitle : undefined} > - - {title} - - - {isOwner ? ( - - ) : null} - {isLoading ? ( - - ) : null} + + ) : ( + <> + + {title} + + + {!isLoading && isOwner ? ( + + ) : null} + + + )} - {artistName ? ( + {isLoading ? ( + + ) : ( { ) : null} - ) : null} + )} - {isLoading ? ( - - ) : null}
{renderStatsRow(isLoading)}
- + {isLoading ? ( + + ) : ( + + )}
{onFilterChange ? ( @@ -327,28 +340,32 @@ export const CollectionHeader = (props: CollectionHeaderProps) => { /> ) : null} - - {description ? ( - - {description} - - ) : null} - - + {isLoading ? ( + + ) : ( + + {description ? ( + + {description} + + ) : null} + + + )}
) return ( - + {topSection} {descriptionSection} diff --git a/packages/web/src/components/tracks-table/TracksTable.tsx b/packages/web/src/components/tracks-table/TracksTable.tsx index 7972a60d205..20aaa65982d 100644 --- a/packages/web/src/components/tracks-table/TracksTable.tsx +++ b/packages/web/src/components/tracks-table/TracksTable.tsx @@ -460,6 +460,7 @@ export const TracksTable = ({ }, [ trackAccessMap, + shouldShowGatedType, disabledTrackEdit, isAlbumPage, onClickRemove, diff --git a/packages/web/src/pages/collection-page/components/desktop/CollectionPage.tsx b/packages/web/src/pages/collection-page/components/desktop/CollectionPage.tsx index 90fe31de292..445ce94b8d9 100644 --- a/packages/web/src/pages/collection-page/components/desktop/CollectionPage.tsx +++ b/packages/web/src/pages/collection-page/components/desktop/CollectionPage.tsx @@ -136,6 +136,22 @@ const CollectionPage = ({ onClickReposts, onClickFavorites }: CollectionPageProps) => { + // DEBUG: + // const title = null + // const pageDescription = null + // const canonicalUrl = null + // const structuredData = null + // const playlistId = null + // const allowReordering = null + // const playing = null + // const previewing = null + // const type = null + // const tracks = { status: Status.LOADING, entries: [] } + // const userId = null + // const status = Status.LOADING + // const metadata = null + // const user = null + const { status, metadata, user } = collection const { isEnabled: isEditAlbumsEnabled } = useFlag(FeatureFlags.EDIT_ALBUMS) const { isEnabled: isPremiumAlbumsEnabled } = useFlag( @@ -150,7 +166,8 @@ const CollectionPage = ({ const collectionLoading = status === Status.LOADING const queuedAndPlaying = playing && isQueued() const queuedAndPreviewing = previewing && isQueued() - const tracksLoading = tracks.status === Status.LOADING + const tracksLoading = + tracks.status === Status.LOADING || tracks.status === Status.IDLE const coverArtSizes = metadata && metadata?.variant !== Variant.SMART @@ -370,7 +387,7 @@ const CollectionPage = ({ )} - {isOwner && !isAlbum && !isNftPlaylist ? ( + {!collectionLoading && isOwner && !isAlbum && !isNftPlaylist ? ( <> From e3bbbedb8e73adeae0fcb3e1ef442e9774d74119 Mon Sep 17 00:00:00 2001 From: amendelsohn Date: Thu, 9 May 2024 17:02:43 -0700 Subject: [PATCH 2/3] remove fade in style --- .../collection/desktop/CollectionHeader.tsx | 22 ++++--------------- 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/packages/web/src/components/collection/desktop/CollectionHeader.tsx b/packages/web/src/components/collection/desktop/CollectionHeader.tsx index 99b4c400820..5c9e74c0503 100644 --- a/packages/web/src/components/collection/desktop/CollectionHeader.tsx +++ b/packages/web/src/components/collection/desktop/CollectionHeader.tsx @@ -173,13 +173,6 @@ export const CollectionHeader = (props: CollectionHeaderProps) => { } const isLoading = !isSsrEnabled && (loading || artworkLoading) - // const isLoading = true - // const title = null - - const fadeIn = { - [styles.show]: !isLoading, - [styles.hide]: isLoading - } const isPremium = isStreamGated && isContentUSDCPurchaseGated(streamConditions) @@ -204,7 +197,7 @@ export const CollectionHeader = (props: CollectionHeaderProps) => { {isLoading ? ( ) : ( - + {!isPublished ? ( ) : null} @@ -239,7 +232,7 @@ export const CollectionHeader = (props: CollectionHeaderProps) => { {title} @@ -255,13 +248,7 @@ export const CollectionHeader = (props: CollectionHeaderProps) => { {isLoading ? ( ) : ( - + {messages.by} {userId !== null ? ( @@ -343,11 +330,10 @@ export const CollectionHeader = (props: CollectionHeaderProps) => { {isLoading ? ( ) : ( - + {description ? ( From 76622092673c8455d807ae88741547b1cefc3f93 Mon Sep 17 00:00:00 2001 From: amendelsohn Date: Thu, 9 May 2024 17:04:37 -0700 Subject: [PATCH 3/3] remove debug code --- .../components/desktop/CollectionPage.tsx | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/packages/web/src/pages/collection-page/components/desktop/CollectionPage.tsx b/packages/web/src/pages/collection-page/components/desktop/CollectionPage.tsx index 445ce94b8d9..92dd35b10da 100644 --- a/packages/web/src/pages/collection-page/components/desktop/CollectionPage.tsx +++ b/packages/web/src/pages/collection-page/components/desktop/CollectionPage.tsx @@ -136,22 +136,6 @@ const CollectionPage = ({ onClickReposts, onClickFavorites }: CollectionPageProps) => { - // DEBUG: - // const title = null - // const pageDescription = null - // const canonicalUrl = null - // const structuredData = null - // const playlistId = null - // const allowReordering = null - // const playing = null - // const previewing = null - // const type = null - // const tracks = { status: Status.LOADING, entries: [] } - // const userId = null - // const status = Status.LOADING - // const metadata = null - // const user = null - const { status, metadata, user } = collection const { isEnabled: isEditAlbumsEnabled } = useFlag(FeatureFlags.EDIT_ALBUMS) const { isEnabled: isPremiumAlbumsEnabled } = useFlag(