import 'react-native-gesture-handler'; import React, { useState } from 'react'; import { LogBox, StatusBar, Text } from 'react-native'; import { SafeAreaProvider } from 'react-native-safe-area-context'; import { Asset } from 'expo-asset'; import AppLoading from 'expo-app-loading'; import { QueryClient, QueryClientProvider } from 'react-query'; import {NavigationContainer, navigationRef} from '@react-navigation/native' import AuthStateProvider from './src/libs/auth/AuthStateProvider' import { Splash } from './src/components/Splash'; import AuthorizedNavigator from './src/navigation/AuthorizedNavigator'; import UnauthorizedNavigator from './src/navigation/UnauthorizedNavigator'; import { MenuProvider } from 'react-native-popup-menu'; import { colors } from './src/utils/GlobalUtils'; const App = () => { LogBox.ignoreAllLogs(); const [loading, setLoading] = useState(false); const _cacheResourcesAsync = async () => { const images = [ require('./assets/logo-white.png'), require('./assets/cover-dark.png'), require('./assets/cover.jpg'), require('./assets/default-pfp.png'), require('./assets/pothole.png'), require('./assets/roadblock.png'), require('./assets/barrier.png'), require('./assets/bump.png'), require('./assets/information.png'), require('./assets/washroom.png'), require('./assets/park.png'), ]; const cacheImages = images.map(image => { return Asset.fromModule(image).downloadAsync(); }); return Promise.all(cacheImages); } const queryClient = new QueryClient() if (loading) { return ( setLoading(false)} onError={console.warn} /> ); } return ( {(authenticated, checkingState) => <> {checkingState ? : <> {authenticated ? : } } } ); } export default App