-
Notifications
You must be signed in to change notification settings - Fork 807
/
MainScreen.ios.js
46 lines (40 loc) · 967 Bytes
/
MainScreen.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
'use strict';
var React = require('react-native');
var {
AsyncStorage,
Image,
StyleSheet,
Text,
View,
} = React;
var Drawer = require('react-native-drawer');
var StoriesList = require('./StoriesList');
var ThemesList = require('./ThemesList');
var DRAWER_REF = 'drawer';
var MainScreen = React.createClass({
getInitialState: function() {
return ({
theme: null,
});
},
onSelectTheme: function(theme) {
this.refs[DRAWER_REF].close();
this.setState({theme: theme});
},
onRefresh: function() {
this.onSelectTheme(this.state.theme);
},
render: function() {
var drawer = <ThemesList onSelectItem={this.onSelectTheme} />;
return (
<Drawer
ref={DRAWER_REF}
openDrawerOffset={100}
panCloseMask={1}
content={drawer} >
<StoriesList theme={this.state.theme} navigator={this.props.navigator}/>
</Drawer>
);
}
});
module.exports = MainScreen;