Skip to content
Open
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
10 changes: 7 additions & 3 deletions spotifymusic08/src/components/ControlCenter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,14 @@ const ControlCenter = () => {
<Pressable onPress={skipToPrevious}>
<Icon style={styles.icon} name="skip-previous" size={40} />
</Pressable>
<Pressable onPress={() => togglePlayback(playBackState)}>
<Pressable onPress={()=>{
if(playBackState.state !== undefined){
togglePlayback(playBackState.state)
}
} >
<Icon
style={styles.icon}
name={playBackState === State.Playing ? "pause" : "play-arrow"}
name={playBackState.state === State.Playing ? "pause" : "play-arrow"}
size={75} />
</Pressable>
<Pressable onPress={skipToNext}>
Expand All @@ -66,4 +70,4 @@ const styles = StyleSheet.create({
},
});

export default ControlCenter
export default ControlCenter