diff --git a/components/Player/component.tsx b/components/Player/component.tsx index a29c3c28..24d44939 100644 --- a/components/Player/component.tsx +++ b/components/Player/component.tsx @@ -30,7 +30,7 @@ export default function Player(): React.JSX.Element { return ( { nowPlaying && ( - + @@ -50,7 +50,7 @@ export default function Player(): React.JSX.Element { /> - + {nowPlaying?.title ?? "Untitled Track"} diff --git a/components/Player/mini-player.tsx b/components/Player/mini-player.tsx index 126a287b..0d9bd3b1 100644 --- a/components/Player/mini-player.tsx +++ b/components/Player/mini-player.tsx @@ -76,17 +76,7 @@ export function Miniplayer({ navigation }: { navigation : NavigationHelpers - { playbackState.state === State.Playing && ( - pause()} /> - )} - - { playbackState.state === State.Paused && ( - play()} /> - )} - - { playbackState.state === State.Buffering || playbackState.state === State.Loading && ( - - )} + { renderPlayPause(playbackState.state, play, pause) } ) +} + +function renderPlayPause(playbackState: State | undefined, play: Function, pause: Function) { + switch (playbackState) { + case (State.Playing) : { + pause()} /> + } + + case (State.Buffering) : + case (State.Loading) : { + + } + + default : { + play()} /> + } + } } \ No newline at end of file