-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
91 lines (83 loc) · 2.23 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 { View, Platform } from 'react-native';
import { Navigation } from 'react-native-navigation';
import { Provider } from 'react-redux';
import { registerScreens } from './src/screens';
import configureStore from './src/store/configureStore';
import Home from './src/screens/Home';
import { defaultNavigator, defaultTabs } from './src/utils/style';
export const store = configureStore();
registerScreens(store, Provider);
const navigatorStyle = {
navBarTranslucent: true,
drawUnderNavBar: false,
navBarTextColor: 'white',
navBarButtonColor: 'white',
statusBarTextColorScheme: 'light',
drawUnderTabBar: false
};
class App extends Component {
constructor(props) {
super(props);
//check logged in status before starting app...
//dispatch action so thunk can be used to update state when login is successfull
//mapStateToProps not working on this page as it's the root of the app
// store.dispatch(checkAuthStatus()).then(loggedIn => {
App.startApp();
}
// render() {
// return <Home />
// }
static startApp() {
Navigation.startSingleScreenApp({
screen: {
screen: 'Home',
title: 'Welcome',
navigatorStyle: {
...defaultNavigator,
statusBarTextColorScheme: 'light'
},
navigatorButtons: {}
},
passProps: {},
animationType: 'slide-down'
});
}
static startAppLoggedIn() {
Navigation.startTabBasedApp({
tabs: [
{
label: 'Words',
screen: 'Words',
title: 'Words',
navigatorStyle: defaultNavigator
},
{
label: 'Courses',
screen: 'Courses',
title: 'Courses',
navigatorStyle: defaultNavigator
},
{
label: 'Books',
screen: 'Books',
title: 'Books',
navigatorStyle: defaultNavigator
},
{
label: 'Video',
screen: 'Video',
title: 'Video',
navigatorStyle: defaultNavigator
},
{
label: 'Settings',
screen: 'Settings',
title: 'Settings',
navigatorStyle: defaultNavigator
}
]
});
}
}
export default App;