-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
58 lines (53 loc) · 1.49 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
import React from "react";
import { createAppContainer } from "react-navigation";
import { createBottomTabNavigator } from "react-navigation-tabs";
import FavoritesScreen from "./screens/FavoritesScreen";
import HomeScreen from "./screens/HomeScreen";
import LoadingView from './components/LoadingView';
import { Provider } from "react-redux";
import { PersistGate } from "redux-persist/lib/integration/react";
import { store, persistor } from "./configureStore";
import Icon from "react-native-vector-icons/Ionicons";
Icon.loadFont();
const TabNavigator = createBottomTabNavigator(
{
MainMenu: {
screen: HomeScreen,
navigationOptions: {
tabBarLabel: "Main menu",
tabBarIcon: ({ tintColor }) => (
<Icon name="ios-home" color={tintColor} size={24} />
)
}
},
Favorites: {
screen: FavoritesScreen,
navigationOptions: {
tabBarLabel: "Favorites",
tabBarIcon: ({ tintColor }) => (
<Icon name="ios-star" color={tintColor} size={24} />
)
}
}
},
{
initialRouteName: "MainMenu",
order: ["MainMenu", "Favorites"],
navigationOptions: {
tabBarVisible: true
}
}
);
const Navigation = createAppContainer(TabNavigator);
class App extends React.Component {
render() {
return (
<Provider store={store}>
<PersistGate loading={<LoadingView />} persistor={persistor}>
<Navigation />
</PersistGate>
</Provider>
);
}
}
export default App;