Skip to content

Commit

Permalink
fix: 🐛 disabled media buttons on banner when no song is playing
Browse files Browse the repository at this point in the history
  • Loading branch information
eeston committed Mar 8, 2024
1 parent 01ec54a commit 2c36e86
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/NowPlayingBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,15 @@ export const NowPlayingBanner = () => {
color={theme.colors.text}
onPress={onPressPlayPause}
size={24}
disabled={!currentTrack}
/>
)}
<PressableSFSymbol
name="forward.fill"
color={theme.colors.text}
size={24}
onPress={onPressNextSong}
disabled={!currentTrack}
/>
</View>
</View>
Expand Down
3 changes: 3 additions & 0 deletions src/components/PressableSFSymbol.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ type PressableSFSymbolProps = {
color: string;
size: number;
testID?: string;
disabled?: boolean;
};

export const PressableSFSymbol = ({
Expand All @@ -15,6 +16,7 @@ export const PressableSFSymbol = ({
color,
size,
testID,
disabled,
}: PressableSFSymbolProps) => {
// const { styles } = useStyles(stylesheet);

Expand All @@ -23,6 +25,7 @@ export const PressableSFSymbol = ({
onPress={onPress}
style={({ pressed }) => [{ opacity: pressed ? 0.5 : 1.0 }]}
testID={testID}
disabled={disabled}
>
<SFSymbol
name={name}
Expand Down

0 comments on commit 2c36e86

Please sign in to comment.