-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
49 lines (42 loc) · 1.51 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
48
49
import React, { useState } from 'react';
/* Navigation */
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
const Stack = createStackNavigator();
import Home from './src/screens/Home';
import Cards from './src/screens/Cards';
import Expansions from './src/screens/Expansions';
import Translation from './src/screens/Translation';
import About from './src/screens/About';
/* Load fonts */
import * as Font from 'expo-font';
import AppLoading from 'expo-app-loading';
const fetchFonts = () => {
return Font.loadAsync({
'ostrich': require('./assets/fonts/OstrichSans-Heavy.otf'),
});
};
function App() {
const [dataLoaded, setDataLoaded] = useState(false);
if (!dataLoaded) {
return(
<AppLoading
startAsync = { fetchFonts }
onFinish = { () => setDataLoaded(true) }
onError = { () => console.log(error) }
/>
);
}
return (
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen name='Home' component={Home} options={{headerShown: false}} />
<Stack.Screen name='Cards' component={Cards} options={{headerShown: false}} />
<Stack.Screen name='Expansions' component={Expansions} options={{headerShown: false}} />
<Stack.Screen name='Translation' component={Translation} options={{headerShown: false}} />
<Stack.Screen name='About' component={About} options={{headerShown: false}} />
</Stack.Navigator>
</NavigationContainer>
);
}
export default App;