Skip to content

Commit

Permalink
[C-2336, C-2388] Playlist style and bug fixes (#3149)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle-Shanks committed Apr 3, 2023
1 parent 1abd3f6 commit cbd5814
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ export const DetailsTile = ({
hideRepostCount,
hideShare,
isPlaying,
isPlayable = true,
onPressFavorites,
onPressOverflow,
onPressPlay,
Expand Down Expand Up @@ -370,6 +371,7 @@ export const DetailsTile = ({
iconPosition='left'
icon={isPlaying ? IconPause : PlayIcon}
onPress={handlePressPlay}
disabled={!isPlayable}
fullWidth
/>
) : null}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ export type DetailsTileProps = {
/** Is the item playing */
isPlaying?: boolean

/** Is the item loaded and in a playable state */
isPlayable?: boolean

/** Function to call when the favorites count is pressed */
onPressFavorites?: GestureResponderHandler

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export const CollectionScreenDetailsTile = ({
} else if (!isPlaying && isQueued) {
dispatch(tracksActions.play())
recordPlay(playingTrackId)
} else if (trackCount > 0) {
} else if (trackCount > 0 && firstTrack) {
dispatch(tracksActions.play(firstTrack.uid))
recordPlay(firstTrack.id)
}
Expand Down Expand Up @@ -222,6 +222,8 @@ export const CollectionScreenDetailsTile = ({
trackCount
])

const isPlayable = isQueued || (trackCount > 0 && !!firstTrack)

return (
<DetailsTile
{...detailsTileProps}
Expand All @@ -236,6 +238,7 @@ export const CollectionScreenDetailsTile = ({
renderHeader={renderHeader}
renderImage={renderImage}
onPressPlay={handlePressPlay}
isPlayable={isPlayable}
/>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { CollectionList } from 'app/components/collection-list'
import { Screen, ScreenContent, ScreenHeader } from 'app/components/core'
import { WithLoader } from 'app/components/with-loader/WithLoader'
import type { ExploreMoodCollection } from 'app/screens/explore-screen/collections'
import { spacing } from 'app/styles/spacing'
const { getCollections, getStatus } = explorePageCollectionsSelectors
const { fetch } = explorePageCollectionsActions

Expand Down Expand Up @@ -45,7 +46,10 @@ export const MoodCollectionScreen = ({
<ScreenHeader text={`${collection.title} Playlists`} />
<ScreenContent>
<WithLoader loading={status === Status.LOADING}>
<CollectionList collection={exploreData} />
<CollectionList
collection={exploreData}
style={{ marginBottom: spacing(12) }}
/>
</WithLoader>
</ScreenContent>
</Screen>
Expand Down

0 comments on commit cbd5814

Please sign in to comment.