From efc68a1515055edbe0eba70b386b16de69e93bcf Mon Sep 17 00:00:00 2001 From: Violet Caulfield Date: Sun, 13 Oct 2024 16:16:07 -0500 Subject: [PATCH] Getting this bad boi to run --- App.tsx | 3 --- components/jellify.tsx | 37 ++++++++++++++++++++----------------- player/queries.ts | 3 +++ 3 files changed, 23 insertions(+), 20 deletions(-) diff --git a/App.tsx b/App.tsx index 7c47ca8b..0d89b89c 100644 --- a/App.tsx +++ b/App.tsx @@ -1,7 +1,6 @@ import './gesture-handler'; import React from 'react'; -import { usePlayer } from './player/queries'; import Jellify from './components/Jellify/component'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; @@ -9,8 +8,6 @@ export default function App(): React.JSX.Element { const queryClient = new QueryClient(); - usePlayer; - return ( diff --git a/components/jellify.tsx b/components/jellify.tsx index c320a8e7..9c68051c 100644 --- a/components/jellify.tsx +++ b/components/jellify.tsx @@ -4,28 +4,31 @@ import { NavigationContainer } from "@react-navigation/native"; import Login from "./Login/component"; import Navigation from "./navigation"; import { Colors } from "react-native/Libraries/NewAppScreen"; +import { usePlayer } from "../player/queries"; export default function Jellify(): React.JSX.Element { const isDarkMode = useColorScheme() === 'dark'; - // Attempt to create API instance, if it fails we aren't authenticated yet - let { error, isLoading, isSuccess } = useApi; - const backgroundStyle = { - backgroundColor: isDarkMode ? Colors.darker : Colors.lighter, - }; - + usePlayer; - return ( - - - - isSuccess ? : - - + // Attempt to create API instance, if it fails we aren't authenticated yet + let { error, isLoading, isSuccess } = useApi; + const backgroundStyle = { + backgroundColor: isDarkMode ? Colors.darker : Colors.lighter, + }; - ); + + return ( + + + + isSuccess ? : + + + + ); } \ No newline at end of file diff --git a/player/queries.ts b/player/queries.ts index ca79d82e..b96c1349 100644 --- a/player/queries.ts +++ b/player/queries.ts @@ -1,6 +1,9 @@ import { useQuery } from "@tanstack/react-query"; import { setupPlayer } from "react-native-track-player/lib/src/trackPlayer"; +/** + * Sets up track player so it's ready for use + */ export const usePlayer = useQuery({ queryKey: [], queryFn: () => {