diff --git a/packages/mobile/src/components/lineup-tile/CollectionTile.tsx b/packages/mobile/src/components/lineup-tile/CollectionTile.tsx index 00ab7d8633e..2e554138e5f 100644 --- a/packages/mobile/src/components/lineup-tile/CollectionTile.tsx +++ b/packages/mobile/src/components/lineup-tile/CollectionTile.tsx @@ -268,7 +268,11 @@ const CollectionTileComponent = ({ user={user} variant={variant} > - + ) } diff --git a/packages/mobile/src/components/lineup-tile/CollectionTileTrackList.tsx b/packages/mobile/src/components/lineup-tile/CollectionTileTrackList.tsx index 8cca9427de6..d1b4eda706b 100644 --- a/packages/mobile/src/components/lineup-tile/CollectionTileTrackList.tsx +++ b/packages/mobile/src/components/lineup-tile/CollectionTileTrackList.tsx @@ -13,11 +13,16 @@ const { getUid } = playerSelectors // Max number of tracks to display const DISPLAY_TRACK_COUNT = 5 +const messages = { + by: 'by' +} + type LineupTileTrackListProps = { isLoading?: boolean onPress: GestureResponderHandler trackCount?: number tracks: LineupTrack[] + isAlbum: boolean } const useStyles = makeStyles(({ palette, spacing, typography }) => ({ @@ -66,9 +71,11 @@ type TrackItemProps = { index: number track?: LineupTrack uid?: UID + isAlbum?: boolean } -const TrackItem = ({ track, index, showSkeleton, uid }: TrackItemProps) => { +const TrackItem = (props: TrackItemProps) => { + const { showSkeleton, index, track, uid, isAlbum } = props const styles = useStyles() const isPlayingUid = useSelector( (state: CommonState) => getUid(state) === uid @@ -90,16 +97,18 @@ const TrackItem = ({ track, index, showSkeleton, uid }: TrackItemProps) => { > {track.title} - - {`by ${track.user.name}`} - + {!isAlbum ? ( + + {`${messages.by} ${track.user.name}`} + + ) : null} )} @@ -107,19 +116,15 @@ const TrackItem = ({ track, index, showSkeleton, uid }: TrackItemProps) => { ) } -export const CollectionTileTrackList = ({ - isLoading, - onPress, - trackCount, - tracks -}: LineupTileTrackListProps) => { +export const CollectionTileTrackList = (props: LineupTileTrackListProps) => { + const { isLoading, onPress, trackCount, tracks, isAlbum } = props const styles = useStyles() if (!tracks.length && isLoading) { return ( <> {range(DISPLAY_TRACK_COUNT).map((i) => ( - + ))} ) @@ -133,6 +138,7 @@ export const CollectionTileTrackList = ({ uid={track.uid} index={index} track={track} + isAlbum={isAlbum} /> ))} {trackCount && trackCount > 5 ? ( diff --git a/packages/mobile/src/components/lineup-tile/LineupTile.tsx b/packages/mobile/src/components/lineup-tile/LineupTile.tsx index 1aedf9081e0..ea30f220ce9 100644 --- a/packages/mobile/src/components/lineup-tile/LineupTile.tsx +++ b/packages/mobile/src/components/lineup-tile/LineupTile.tsx @@ -67,6 +67,7 @@ export const LineupTile = ({ const currentUserId = useSelector(getUserId) const isOwner = user_id === currentUserId const isCollection = 'playlist_id' in item + const isAlbum = 'is_album' in item && item.is_album const isTrack = 'track_id' in item const contentId = isTrack ? item.track_id : item.playlist_id const streamConditions = item.stream_conditions ?? null @@ -122,6 +123,7 @@ export const LineupTile = ({ title={title} user={user} isPlayingUid={isPlayingUid} + type={isTrack ? 'track' : isAlbum ? 'album' : 'playlist'} /> {coSign ? : null} { const navigation = useNavigation() const styles = useStyles() @@ -90,6 +92,16 @@ export const LineupTileMetadata = ({ startOpacity={0} duration={500} > + {type !== 'track' ? ( + + {type} + + ) : null} { if (streamConditions && !isOwner) { - if (isPurchase) { + if (isPurchase && isReadonly) { return ( - {messages.createdBy} )) }, [ tracks, isLoading, + isAlbum, userHandle, playingUid, size, diff --git a/packages/web/src/components/track/desktop/PlaylistTile.tsx b/packages/web/src/components/track/desktop/PlaylistTile.tsx index 97495df7381..89f0288a492 100644 --- a/packages/web/src/components/track/desktop/PlaylistTile.tsx +++ b/packages/web/src/components/track/desktop/PlaylistTile.tsx @@ -126,11 +126,7 @@ const PlaylistTile = ({ hasStreamAccess={hasStreamAccess} /> - + {renderTracks()} {renderMoreTracks()} diff --git a/packages/web/src/components/track/desktop/TrackListItem.module.css b/packages/web/src/components/track/desktop/TrackListItem.module.css index 72f881a5d7c..e327658f61b 100644 --- a/packages/web/src/components/track/desktop/TrackListItem.module.css +++ b/packages/web/src/components/track/desktop/TrackListItem.module.css @@ -49,6 +49,10 @@ opacity: 1; } +.playlistTrack.lastTrack { + border-bottom: none; +} + .wrapper { display: flex; align-items: center; diff --git a/packages/web/src/components/track/desktop/TrackListItem.tsx b/packages/web/src/components/track/desktop/TrackListItem.tsx index 549e4be1622..568a7eab22e 100644 --- a/packages/web/src/components/track/desktop/TrackListItem.tsx +++ b/packages/web/src/components/track/desktop/TrackListItem.tsx @@ -26,6 +26,7 @@ const makeStrings = ({ deleted }: { deleted: boolean }) => ({ type TrackListItemProps = { index: number isLoading: boolean + isAlbum: boolean active: boolean size: TrackTileSize disableActions: boolean @@ -35,6 +36,7 @@ type TrackListItemProps = { artistHandle: string track?: EnhancedCollectionTrack forceSkeleton?: boolean + isLastTrack?: boolean } const TrackListItem = ({ @@ -47,6 +49,8 @@ const TrackListItem = ({ goToRoute, togglePlay, isLoading, + isAlbum, + isLastTrack, forceSkeleton = false }: TrackListItemProps) => { const menuRef = useRef(null) @@ -135,7 +139,8 @@ const TrackListItem = ({ [styles.deleted]: deleted, [styles.active]: active, [styles.disabled]: disableActions || deleted, - [styles.noBorder]: isLoading + [styles.noBorder]: isLoading, + [styles.lastTrack]: isLastTrack })} onClick={onPlayTrack} > @@ -161,16 +166,18 @@ const TrackListItem = ({ {track.title} {strings.deleted} -
-
{strings.by}
- {track.user.is_deactivated ? ( - `${track.user.name} [Deactivated]` - ) : ( - - {track.user.name} - - )} -
+ {!isAlbum ? ( +
+
{strings.by}
+ {track.user.is_deactivated ? ( + `${track.user.name} [Deactivated]` + ) : ( + + {track.user.name} + + )} +
+ ) : null}
{track.duration && formatSeconds(track.duration)} diff --git a/packages/web/src/components/track/desktop/TrackTile.module.css b/packages/web/src/components/track/desktop/TrackTile.module.css index 87608b8c4d8..7906e764d94 100644 --- a/packages/web/src/components/track/desktop/TrackTile.module.css +++ b/packages/web/src/components/track/desktop/TrackTile.module.css @@ -3,6 +3,7 @@ position: relative; background: var(--harmony-white); border: var(--border-width) solid var(--harmony-n-100); + border-bottom: 0; border-radius: var(--harmony-unit-2) var(--harmony-unit-2) 0px 0px; display: inline-flex; width: 100%; @@ -11,6 +12,7 @@ } .container.standalone { + border: var(--border-width) solid var(--harmony-n-100); transform: scale3d(1, 1, 1); border-radius: var(--harmony-unit-2); box-shadow: 0px 2px 5px var(--tile-shadow-3), 0px 1px 0px var(--tile-shadow-2), diff --git a/packages/web/src/components/track/mobile/PlaylistTile.module.css b/packages/web/src/components/track/mobile/PlaylistTile.module.css index 3577bf7f4f9..c3faf82f5c5 100644 --- a/packages/web/src/components/track/mobile/PlaylistTile.module.css +++ b/packages/web/src/components/track/mobile/PlaylistTile.module.css @@ -71,11 +71,6 @@ } .statItem { - display: flex; - align-items: center; - justify-content: center; - padding: 0px 10px; - margin-right: 12px; transform: scale(1); transition: transform 0.07s ease-in-out; } @@ -104,30 +99,6 @@ top: 0; } -.stats { - display: flex; - flex: 0 0 30px; - align-items: center; - justify-content: space-between; - margin: var(--harmony-unit-2); - background-color: var(--harmony-static-white); -} - -.statText { - font-weight: var(--harmony-font-medium); - font-size: var(--harmony-font-xs); - letter-spacing: 0.2px; - line-height: 11px; - color: var(--harmony-n-400); -} - -.stats svg { - width: 14px; - height: 14px; - position: relative; - bottom: 1px; -} - .albumArtContainer { height: 72px; margin: 10px 12px 0px 10px; diff --git a/packages/web/src/components/track/mobile/PlaylistTile.tsx b/packages/web/src/components/track/mobile/PlaylistTile.tsx index df7ea7f364f..d8defd0e407 100644 --- a/packages/web/src/components/track/mobile/PlaylistTile.tsx +++ b/packages/web/src/components/track/mobile/PlaylistTile.tsx @@ -57,6 +57,7 @@ const { getGatedContentStatusMap } = gatedContentSelectors type TrackItemProps = { index: number track?: LineupTrack + isAlbum: boolean active: boolean forceSkeleton?: boolean } @@ -64,25 +65,32 @@ type TrackItemProps = { // Max number of track to display in a playlist const DISPLAY_TRACK_COUNT = 5 +const messages = { + by: 'by' +} + const TrackItem = (props: TrackItemProps) => { + const { active, index, isAlbum, track, forceSkeleton } = props return ( <>
- {props.forceSkeleton ? ( + {forceSkeleton ? ( - ) : props.track ? ( + ) : track ? ( <> -
{props.index + 1}
-
{props.track.title}
-
- {' '} - {`by ${props.track.user.name}`}{' '} -
+
{index + 1}
+
{track.title}
+ {!isAlbum ? ( +
+ {' '} + {`${messages.by} ${track.user.name}`}{' '} +
+ ) : null} ) : null}
@@ -95,6 +103,7 @@ type TrackListProps = { tracks: LineupTrack[] goToCollectionPage: (e: MouseEvent) => void isLoading?: boolean + isAlbum: boolean numLoadingSkeletonRows?: number trackCount?: number } @@ -104,6 +113,7 @@ const TrackList = ({ activeTrackUid, goToCollectionPage, isLoading, + isAlbum, numLoadingSkeletonRows, trackCount }: TrackListProps) => { @@ -111,7 +121,13 @@ const TrackList = ({ return ( {range(numLoadingSkeletonRows).map((i) => ( - + ))} ) @@ -124,6 +140,7 @@ const TrackList = ({ key={track.uid} active={activeTrackUid === track.uid} index={index} + isAlbum={isAlbum} track={track} /> ))} @@ -214,6 +231,7 @@ const PlaylistTile = (props: PlaylistTileProps & ExtraProps) => { isUnlisted, playlistTitle, isPlaying, + isAlbum, ownerId, isStreamGated, hasStreamAccess, @@ -349,80 +367,89 @@ const PlaylistTile = (props: PlaylistTileProps & ExtraProps) => {
-
- - {isReadonly ? specialContentLabel : null} - {!!(props.repostCount || props.saveCount) && ( - <> -
+ + + + {isReadonly ? specialContentLabel : null} + {!!(props.repostCount || props.saveCount) && ( + <> + + + {formatCount(props.saveCount)} + + + + {formatCount(props.repostCount)} + + + )} + + {isReadonly ? ( + - {formatCount(props.saveCount)} - -
-
- {formatCount(props.repostCount)} - -
- - )} - {isReadonly ? ( - - {renderLockedContent({ - hasStreamAccess, - isOwner, - isStreamGated, - streamConditions, - gatedTrackStatus: gatedContentStatus, - variant: isPurchase ? 'premium' : 'gated', - onClickGatedUnlockPill - })} - - ) : null} -
+
+ ) : null} + +