-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
44 lines (42 loc) · 1.49 KB
/
App.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import { StatusBar } from 'expo-status-bar';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import { Provider } from 'react-redux';
import useCachedResources from './hooks/useCachedResources';
import useColorScheme from './hooks/useColorScheme';
import Navigation from './navigation';
import { store } from './app/store';
import AppLoading from 'expo-app-loading';
import { useFonts } from 'expo-font';
import { RootSiblingParent } from 'react-native-root-siblings';
import { LogBox } from 'react-native';
import { StripeProvider } from '@stripe/stripe-react-native';
import Constants from 'expo-constants';
export default function App() {
LogBox.ignoreAllLogs(true);
const isLoadingComplete = useCachedResources();
const colorScheme = useColorScheme();
let [fontsLoaded] = useFonts({
SansPro: require('./assets/fonts/SourceSansPro-SemiBold.ttf'),
SansProLight: require('./assets/fonts/SourceSansPro-Light.ttf'),
SansProRegular: require('./assets/fonts/SourceSansPro-Regular.ttf'),
});
if (!fontsLoaded) {
return <AppLoading />;
}
if (!isLoadingComplete) {
return null;
} else {
return (
<StripeProvider publishableKey={Constants?.manifest?.extra?.stripe_pk}>
<Provider store={store}>
<SafeAreaProvider>
<RootSiblingParent>
<Navigation colorScheme="light" />
<StatusBar hidden />
</RootSiblingParent>
</SafeAreaProvider>
</Provider>
</StripeProvider>
);
}
}