-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
47 lines (40 loc) · 1.28 KB
/
App.js
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
45
46
47
import React, { useCallback, useState, useEffect } from 'react';
import { StyleSheet, View, Text } from 'react-native';
import { useFonts } from 'expo-font';
import * as SplashScreen from 'expo-splash-screen';
import { NavigationContainer } from '@react-navigation/native';
import { useRoute } from './router';
// const screenDimensions = Dimensions.get('window').height;
SplashScreen.preventAutoHideAsync();
export default function App() {
// const [dimensionsHeigth, setDimensionsHeigth] = useState(screenDimensions);
const routing = useRoute({});
const [fontsLoaded] = useFonts({
'Roboto-Regular': require('./assets/fonts/Roboto/Roboto-Regular.ttf'),
'Roboto-Medium': require('./assets/fonts/Roboto/Roboto-Medium.ttf'),
'Roboto-Bold': require('./assets/fonts/Roboto/Roboto-Bold.ttf'),
});
const onLayoutRootView = useCallback(async () => {
if (fontsLoaded) {
await SplashScreen.hideAsync();
}
}, [fontsLoaded]);
if (!fontsLoaded) {
return null;
}
return (
<View style={styles.container} onLayout={onLayoutRootView}>
<NavigationContainer>{routing}</NavigationContainer>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
},
image: {
flex: 1,
resizeMode: 'cover',
justifyContent: 'flex-end',
},
});