-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathApp.js
110 lines (96 loc) · 2.79 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
import React from 'react';
import {Provider as PaperProvider} from 'react-native-paper';
import {Provider as StoreProvider} from 'react-redux';
import {PersistGate} from 'redux-persist/integration/react'
import Info from './src/components/info/Info';
import Schedule from './src/components/schedule/Schedule';
import EventDetails from './src/components/schedule/EventDetails';
import Films from './src/components/films/Films';
import {createAppContainer, createStackNavigator} from 'react-navigation';
import {createMaterialBottomTabNavigator} from 'react-navigation-material-bottom-tabs';
import FATabBarIcon from "./src/components/shared/FATabBarIcon";
import MaterialTabBarIcon from "./src/components/shared/MaterialTabBarIcon";
import {persistor, store} from "./src/redux/store";
import SplashScreen from 'react-native-splash-screen';
const InfoNavigator = createStackNavigator(
{
Info: {
screen: Info
}
}, {
initialRouteName: 'Info',
}
);
InfoNavigator.navigationOptions = {
tabBarIcon: MaterialTabBarIcon('info-outline'),
};
const ScheduleNavigator = createStackNavigator(
{
Schedule: {
screen: Schedule,
},
EventDetails: {
screen: EventDetails,
}
},
);
ScheduleNavigator.navigationOptions = ({navigation}) => {
let tabBarVisible = true;
if (navigation.state.index > 0) {
tabBarVisible = false;
}
return {
tabBarIcon: FATabBarIcon('calendar'),
tabBarVisible,
};
};
const FilmsNavigator = createStackNavigator(
{
Films: {
screen: Films,
},
// EventDetails: {
// screen: EventDetails,
// }
}, {
initialRouteName: 'Films',
}
);
FilmsNavigator.navigationOptions = ({navigation}) => {
let tabBarVisible = true;
if (navigation.state.index > 0) {
tabBarVisible = false;
}
return {
tabBarIcon: MaterialTabBarIcon('movie'),
tabBarVisible,
};
};
const AppNavigator = createMaterialBottomTabNavigator(
{
Info: InfoNavigator,
Schedule: ScheduleNavigator,
Films: FilmsNavigator,
}, {
initialRouteName: 'Schedule',
activeColor: '#f0edf6',
barStyle: { backgroundColor: '#ee5956' }
});
const AppContainer = createAppContainer(AppNavigator);
//TODO: Return AppLoading if PersistGate incomplete
export default class App extends React.Component {
componentDidMount() {
SplashScreen.hide();
}
render() {
return (
<StoreProvider store={store}>
<PersistGate persistor={persistor}>
<PaperProvider>
<AppContainer/>
</PaperProvider>
</PersistGate>
</StoreProvider>
);
}
}