-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
41 lines (34 loc) · 1.03 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
import { useEffect } from 'react';
import { StyleSheet, View } from 'react-native';
import * as SplashScreen from 'expo-splash-screen';
import { StatusBar } from 'expo-status-bar';
import { useFonts } from 'expo-font';
import OnboardingScreen from './src/screens/OnboardingScreen';
SplashScreen.preventAutoHideAsync();
export default function App() {
const [loaded, error] = useFonts({
HelveticaNeue: require('./assets/fonts/HelveticaNeueRoman.otf'),
'HelveticaNeue-Bold': require('./assets/fonts/HelveticaNeueBold.otf'),
'HelveticaNeue-Light': require('./assets/fonts/HelveticaNeueLight.otf'),
'HelveticaNeue-Medium': require('./assets/fonts/HelveticaNeueMedium.otf'),
});
useEffect(() => {
if (loaded || error) {
SplashScreen.hideAsync();
}
}, [loaded, error]);
if (!loaded && !error) {
return null;
}
return (
<View style={styles.container}>
<StatusBar style="auto" />
<OnboardingScreen />
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
},
});