Getting this bad boi to run

This commit is contained in:
Violet Caulfield
2024-10-13 16:16:07 -05:00
parent 241ed01c6d
commit efc68a1515
3 changed files with 23 additions and 20 deletions

View File

@@ -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 (
<QueryClientProvider client={queryClient}>
<Jellify />

View File

@@ -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 (
<NavigationContainer>
<SafeAreaView style={backgroundStyle}>
<StatusBar
barStyle={isDarkMode ? 'light-content' : 'dark-content'}
backgroundColor={backgroundStyle.backgroundColor}
/>
isSuccess ? <Navigation /> : <Login />
</SafeAreaView>
</NavigationContainer>
// 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 (
<NavigationContainer>
<SafeAreaView style={backgroundStyle}>
<StatusBar
barStyle={isDarkMode ? 'light-content' : 'dark-content'}
backgroundColor={backgroundStyle.backgroundColor}
/>
isSuccess ? <Navigation /> : <Login />
</SafeAreaView>
</NavigationContainer>
);
}

View File

@@ -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: () => {