mirror of
https://github.com/Jellify-Music/App.git
synced 2026-05-04 18:00:05 -05:00
36 lines
1.1 KiB
TypeScript
36 lines
1.1 KiB
TypeScript
import { SafeAreaView, StatusBar, useColorScheme } from "react-native";
|
|
import { NavigationContainer } from "@react-navigation/native";
|
|
import Login from "./Login/component";
|
|
import Navigation from "./navigation";
|
|
import { Colors } from "react-native/Libraries/NewAppScreen";
|
|
import { setupPlayer } from "react-native-track-player/lib/src/trackPlayer";
|
|
import { useServerUrl } from "../api/queries";
|
|
|
|
export default function Jellify(): React.JSX.Element {
|
|
|
|
const isDarkMode = useColorScheme() === 'dark';
|
|
|
|
setupPlayer();
|
|
|
|
// Attempt to create API instance, if it fails we aren't authenticated yet
|
|
const backgroundStyle = {
|
|
backgroundColor: isDarkMode ? Colors.darker : Colors.lighter,
|
|
};
|
|
|
|
let data, isLoading, isSuccess = false;
|
|
|
|
|
|
return (
|
|
<NavigationContainer>
|
|
<SafeAreaView style={backgroundStyle}>
|
|
<StatusBar
|
|
barStyle={isDarkMode ? 'light-content' : 'dark-content'}
|
|
backgroundColor={backgroundStyle.backgroundColor}
|
|
/>
|
|
{ isSuccess && <Navigation /> }
|
|
{ !isSuccess && <Login /> }
|
|
</SafeAreaView>
|
|
</NavigationContainer>
|
|
|
|
);
|
|
} |