From 3f625ccc8f6b4c4264cc8a71daae5e6ab85d2264 Mon Sep 17 00:00:00 2001 From: Violet Caulfield Date: Wed, 1 Jan 2025 15:23:36 -0600 Subject: [PATCH] player layout fixes --- components/Player/component.tsx | 4 ++-- components/Player/mini-player.tsx | 29 ++++++++++++++++++----------- 2 files changed, 20 insertions(+), 13 deletions(-) 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