-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
66 lines (58 loc) · 1.64 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import React, { useState } from 'react';
import { Provider } from 'react-redux';
import {
Home,
Instruction,
GameMain,
GameResult,
GameScore,
GameDecision,
} from 'src/pages';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import * as Font from 'expo-font';
import { AppLoading } from 'expo';
import store from './src/redux/store';
const PTSansNarrowBold = require('./assets/fonts/PTSansNarrow-Bold.ttf');
const PTSansNarrow = require('./assets/fonts/PTSansNarrow-Regular.ttf');
export const fetchFonts = async () => {
return Font.loadAsync({
PTSansNarrow,
PTSansNarrowBold,
});
};
const Stack = createStackNavigator();
export const Navigation = () => {
return (
<NavigationContainer>
<Stack.Navigator
headerMode="none"
screenOptions={{ gestureEnabled: false }}
>
<Stack.Screen name="Home" component={Home} />
<Stack.Screen name="Instruction" component={Instruction} />
<Stack.Screen name="GameMain" component={GameMain} />
<Stack.Screen name="GameResult" component={GameResult} />
<Stack.Screen name="GameScore" component={GameScore} />
<Stack.Screen name="GameDecision" component={GameDecision} />
</Stack.Navigator>
</NavigationContainer>
);
};
function App() {
const [dataLoaded, setDataLoaded] = useState(false);
if (!dataLoaded) {
return (
<AppLoading
startAsync={fetchFonts}
onFinish={() => setDataLoaded(true)}
/>
);
}
return (
<Provider store={store}>
<Navigation />
</Provider>
);
}
export default App;