-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.ios.js
54 lines (47 loc) · 1.29 KB
/
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// run next to create production bundle
// react-native bundle --dev false --minify --platform ios --bundle-output ios/main.jsbundle --entry-file index.ios.js
'use strict';
var React = require('react-native');
var {
AppRegistry,
NavigatorIOS
} = React;
const { appTitle } = require('./config');
const MainCanvas = require('./MainCanvas');
const ReadingPane = require('./ReadingPane');
var NewsApp = React.createClass({
handlePressMenuIcon() {
this.mainCanvas && this.mainCanvas.toggleDrawer();
},
handlePressArticle(article, channelTitle) {
let { title, metadata } = article;
this.refs.navigator.push({
title: channelTitle,
component: ReadingPane,
passProps: {
article
}
});
},
render() {
return (
<NavigatorIOS
ref='navigator'
style={{flex:1}}
initialRoute={{
component: MainCanvas,
title: appTitle,
passProps: {
onMount: (mainCanvas) => {
this.mainCanvas = mainCanvas;
},
onPressArticle: this.handlePressArticle
},
leftButtonIcon: require('./assets/icon-menu-ios.png'),
onLeftButtonPress: this.handlePressMenuIcon
}}
/>
);
}
});
AppRegistry.registerComponent('NewsApp', () => NewsApp);