-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLedgexNavigator.js
56 lines (48 loc) · 1.27 KB
/
LedgexNavigator.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
'use strict';
var React = require('react-native');
var {
Navigator,
} = React;
var LedgexHome = require('./LedgexHome');
var LedgexLogin = require('./LedgexLogin');
var LedgexFormScreen = require('./LedgexFormScreen');
var LedgexNavigator = React.createClass({
renderScene: function(route, nav) {
switch (route.id) {
case 'home':
return (
<LedgexHome navigator={nav} auth_headers={route.auth_headers}/>
);
case 'form':
return (
<LedgexFormScreen navigator={nav} data={route.data} auth_headers={route.auth_headers}/>
);
default:
return (
<LedgexLogin navigator={nav}/>
);
}
},
render: function() {
return (
<Navigator
ref={this._setNavigatorRef}
style={{flex: 1}}
initialRoute={{ }}
renderScene={this.renderScene}
configureScene={(route) => {
if (route.sceneConfig) {
return route.sceneConfig;
}
return Navigator.SceneConfigs.FloatFromBottom;
}}
/>
);
},
_setNavigatorRef: function(navigator) {
if (navigator !== this._navigator) {
this._navigator = navigator;
}
},
});
module.exports = LedgexNavigator;