Skip to content

Commit

Permalink
Fix mobile play icons (#7628)
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanjeffers authored Feb 16, 2024
1 parent 469bf40 commit 9d38155
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 22 deletions.
23 changes: 3 additions & 20 deletions packages/mobile/src/components/track-list/TablePlayButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,29 @@ import type { StyleProp, ViewStyle } from 'react-native'
import { TouchableOpacity } from 'react-native'

import { IconPause, IconPlay } from '@audius/harmony-native'
import { makeStyles } from 'app/styles'

type TablePlayButtonProps = {
playing?: boolean
paused: boolean
hideDefault?: boolean
onPress?: () => void
styles?: {
root: StyleProp<ViewStyle>
svg: StyleProp<ViewStyle>
}
}

const useStyles = makeStyles(({ palette, spacing }) => ({
root: {},
svg: {},
hideDefault: {}
}))

export const TablePlayButton = ({
playing = false,
paused,
hideDefault = true,
onPress = () => {},
styles: propStyles
}: TablePlayButtonProps) => {
const styles = useStyles()

return (
<TouchableOpacity style={[styles.root, propStyles?.root]} onPress={onPress}>
<TouchableOpacity style={propStyles?.root} onPress={onPress}>
{playing && !paused ? (
<IconPause style={[styles.svg, propStyles?.svg]} />
<IconPause color='white' style={propStyles?.svg} />
) : (
<IconPlay
style={[
styles.svg,
hideDefault && !playing ? styles.hideDefault : {},
propStyles?.svg
]}
/>
<IconPlay color='default' style={propStyles?.svg} />
)}
</TouchableOpacity>
)
Expand Down
2 changes: 1 addition & 1 deletion packages/mobile/src/components/track-list/TrackArtwork.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const TrackArtwork = (props: TrackArtworkProps) => {
) : null}
{isActive ? (
<View style={styles.artworkIcon}>
<ActiveIcon />
<ActiveIcon color='staticWhite' />
</View>
) : null}
</TrackImage>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,6 @@ const TrackListItemComponent = (props: TrackListItemComponentProps) => {
<TablePlayButton
playing
paused={!isPlaying}
hideDefault={false}
onPress={onPressTrack}
/>
</View>
Expand Down

0 comments on commit 9d38155

Please sign in to comment.