-
Notifications
You must be signed in to change notification settings - Fork 165
/
Copy pathindex.ios.js
40 lines (36 loc) · 916 Bytes
/
index.ios.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
/**
* Sample React Native App
* https://github.com/facebook/react-native
*/
'use strict';
import React, {
AppRegistry,
Component,
Navigator,
StyleSheet,
TouchableOpacity,
Text
} from 'react-native';
import MainScreen from './MainScreen';
import JdWebView from './WebView';
class JdApp extends Component {
render() {
return (
<Navigator
initialRoute={{name: 'main', index: 0, id:'main'}}
renderScene={(route, navigator) => JdApp._renderPage(route,navigator)}
/>
)
}
static _renderPage(route, nav) {
switch (route.id) {
case 'main':
return (<MainScreen nav={nav}/>);
break;
case 'webview':
return (<JdWebView url={route.url}/>);
break;
}
}
}
AppRegistry.registerComponent('JdApp', () => JdApp);