-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
91 lines (82 loc) · 2.53 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
import React, { Component } from 'react';
import { AppRegistry, Text } from 'react-native';
import {
createSwitchNavigator,
createBottomTabNavigator,
createAppContainer } from 'react-navigation';
import { FontAwesome5 } from '@expo/vector-icons';
import { Provider } from 'react-redux';
import { createStore } from 'redux';
import reducers from './src/reducers';
import i18n from './src/i18n';
import WelcomeScreen from './src/screens/WelcomeScreen';
import PracticeScreen from './src/screens/PracticeScreen';
import ResultsScreen from './src/screens/ResultsScreen';
import HighScoresScreen from './src/screens/HighScoresScreen';
import SettingsScreen from './src/screens/SettingsScreen';
import SplashScreen from './src/screens/SplashScreen';
const HomeNavigator = createSwitchNavigator({
Welcome: WelcomeScreen,
Practice: PracticeScreen,
Results: ResultsScreen
});
const AppNavigator = createBottomTabNavigator(
{
Home: {
screen: HomeNavigator,
navigationOptions: {
tabBarLabel: ({tintColor}) =>
<Text style={ { fontSize: 10, color: tintColor, textAlign: 'center' } }>
{i18n.t('navigation.home')}
</Text>,
tabBarIcon: ({tintColor}) =>
<FontAwesome5 name="home" size={25} color={tintColor} />
},
},
HighScores: {
screen: HighScoresScreen,
navigationOptions: {
tabBarLabel: ({tintColor}) =>
<Text style={ { fontSize: 10, color: tintColor, textAlign: 'center' } }>
{i18n.t('navigation.highScores')}
</Text>,
tabBarIcon: ({tintColor}) =>
<FontAwesome5 name="chart-bar" size={25} color={tintColor} />
},
},
Settings: {
screen: SettingsScreen,
navigationOptions: {
tabBarLabel: ({tintColor}) =>
<Text style={ { fontSize: 10, color: tintColor, textAlign: 'center' } }>
{i18n.t('navigation.settings')}
</Text>,
tabBarIcon: ({tintColor}) =>
<FontAwesome5 name="cogs" size={25} color={tintColor} />
},
}
},
{
tabBarOptions: {
activeTintColor: 'orange',
inactiveTintColor: 'gray',
showLabel: true
}
}
);
const InitialNavigator = createSwitchNavigator({
Splash: SplashScreen,
App: AppNavigator
});
const AppContainer = createAppContainer(InitialNavigator);
class App extends Component {
render() {
return (
<Provider store={createStore(reducers)}>
<AppContainer />
</Provider>
);
}
}
export default App;
AppRegistry.registerComponent('SightWords', () => App);