-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.android.js
47 lines (43 loc) · 1.53 KB
/
index.android.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
import React from 'react'
import {
AppRegistry
} from 'react-native'
import { Provider } from 'react-redux'
import configureStore from './configureStore'
// import App from './app'
import TeamMembers from './components/TeamMembers'
import AddMember from './components/AddMember'
import EditMember from './components/EditMember'
import {
Scene,
Reducer,
Router,
Switch,
Modal,
Actions,
ActionConst,
} from 'react-native-router-flux';
const store = configureStore()
const onExitApp = () => {
Alert.alert(
'Exit',
'Are you sure you want to exit this app',
[
{ text: 'Cancel', onPress: () => {} },
{ text: 'YES', onPress: () => BackAndroid.exitApp() },
]
);
return true;
};
const Team = () => (
<Provider store={store}>
<Router onExitApp={onExitApp}>
<Scene key="root" navigationBarStyle={{backgroundColor:'#944dff'}} titleStyle={{color:'white'}} backButtonImage={require('./images/back.png')} >
<Scene key="teamMembers" initial={true} component={TeamMembers} title="Team Members" onRight={() => Actions.addMember()} rightButtonImage={require('./images/plus.png')} />
<Scene key="addMember" component={AddMember} title="add a team member" onRight={() => Actions.teamMembers()} rightButtonImage={require('./images/close.png')} />
<Scene key="editMember" component={EditMember} title="Edit team member" onRight={() => Actions.teamMembers()} rightButtonImage={require('./images/close.png')} />
</Scene>
</Router>
</Provider>
)
AppRegistry.registerComponent('Team', () => Team)