mirror of
https://github.com/Jellify-Music/App.git
synced 2026-02-05 18:09:18 -06:00
player layout fixes
This commit is contained in:
@@ -30,7 +30,7 @@ export default function Player(): React.JSX.Element {
|
||||
return (
|
||||
<SafeAreaView>
|
||||
{ nowPlaying && (
|
||||
<YStack alignItems="center">
|
||||
<YStack>
|
||||
|
||||
<HStack alignItems="center">
|
||||
|
||||
@@ -50,7 +50,7 @@ export default function Player(): React.JSX.Element {
|
||||
/>
|
||||
</HStack>
|
||||
|
||||
<HStack justifyContent="space-between">
|
||||
<HStack>
|
||||
|
||||
<YStack alignItems="flex-start" justifyContent="flex-start" flex={3}>
|
||||
<Text>{nowPlaying?.title ?? "Untitled Track"}</Text>
|
||||
|
||||
@@ -76,17 +76,7 @@ export function Miniplayer({ navigation }: { navigation : NavigationHelpers<Para
|
||||
</YStack>
|
||||
|
||||
<XStack flex={2}>
|
||||
{ playbackState.state === State.Playing && (
|
||||
<Icon name="pause" large onPress={() => pause()} />
|
||||
)}
|
||||
|
||||
{ playbackState.state === State.Paused && (
|
||||
<Icon name="play" large onPress={() => play()} />
|
||||
)}
|
||||
|
||||
{ playbackState.state === State.Buffering || playbackState.state === State.Loading && (
|
||||
<Spinner size="small" color={Colors.Primary}/>
|
||||
)}
|
||||
{ renderPlayPause(playbackState.state, play, pause) }
|
||||
|
||||
<Icon
|
||||
large
|
||||
@@ -97,4 +87,21 @@ export function Miniplayer({ navigation }: { navigation : NavigationHelpers<Para
|
||||
)}
|
||||
</BlurView>
|
||||
)
|
||||
}
|
||||
|
||||
function renderPlayPause(playbackState: State | undefined, play: Function, pause: Function) {
|
||||
switch (playbackState) {
|
||||
case (State.Playing) : {
|
||||
<Icon name="pause" large onPress={() => pause()} />
|
||||
}
|
||||
|
||||
case (State.Buffering) :
|
||||
case (State.Loading) : {
|
||||
<Spinner size="small" color={Colors.Primary}/>
|
||||
}
|
||||
|
||||
default : {
|
||||
<Icon name="play" large onPress={() => play()} />
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user