Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mobile play icons #7628

Merged
merged 1 commit into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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