From 1742e832789eb09e356562a2974d774dc6cd5728 Mon Sep 17 00:00:00 2001 From: Violet Caulfield Date: Sat, 28 Dec 2024 15:21:04 -0600 Subject: [PATCH] miniplayer buttons --- components/Global/icon.tsx | 25 +++++++++++++++--- components/Login/helpers/server-library.tsx | 2 +- components/Player/mini-player.tsx | 29 ++++++++++++++++----- 3 files changed, 44 insertions(+), 12 deletions(-) diff --git a/components/Global/icon.tsx b/components/Global/icon.tsx index 91fc7670..968b04be 100644 --- a/components/Global/icon.tsx +++ b/components/Global/icon.tsx @@ -3,11 +3,28 @@ import MaterialCommunityIcons from "react-native-vector-icons/MaterialCommunityI import { Colors } from "react-native/Libraries/NewAppScreen" const iconDimensions = { - width: 25, - height: 25 + width: 50, + height: 50 } -export default function Icon({ name }: { name: string }) : React.JSX.Element { - return +const largeDimensions = { + width: 100, + height: 100 +} +export default function Icon({ name, onPress, large }: { name: string, onPress?: Function, large?: boolean }) : React.JSX.Element { + + let dimensions = large ? largeDimensions : iconDimensions + + return ( + { + if (onPress) + onPress(); + }} + {...dimensions} + /> + ) } \ No newline at end of file diff --git a/components/Login/helpers/server-library.tsx b/components/Login/helpers/server-library.tsx index 8d90caba..b81c6e6e 100644 --- a/components/Login/helpers/server-library.tsx +++ b/components/Login/helpers/server-library.tsx @@ -46,7 +46,7 @@ export default function ServerLibrary(): React.JSX.Element {

Select Music Library

{ isPending ? ( - + ) : ( }) : React.JSX.Element { + const playbackState = usePlaybackState(); + const activeTrack = useActiveTrack() as JellifyTrack | undefined; const { setShowPlayer } = usePlayerContext(); @@ -27,12 +29,25 @@ export function Miniplayer({ navigation }: { navigation : NavigationHelpers { pause() }}> + + + { playbackState.state === State.Playing && ( - + )} - + { playbackState.state === State.Paused && ( + play()} /> + )} + + { playbackState.state === State.Buffering || playbackState.state === State.Loading && ( + + )} + + skipToNext()} + /> )