forked from taskrabbit/ReactNativeSampleApp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNavigationHeader.js
More file actions
67 lines (58 loc) · 1.53 KB
/
NavigationHeader.js
File metadata and controls
67 lines (58 loc) · 1.53 KB
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
57
58
59
60
61
62
63
64
65
66
67
import React from 'react';
import {
NavigationExperimental,
StyleSheet,
} from 'react-native';
import cssVar from '../Lib/cssVar';
import NavigationTitle from '../Navigation/NavigationTitle';
import NavigationButton from '../Navigation/NavigationButton';
const {
Header: NavigationHeader,
} = NavigationExperimental;
var _NavigationHeader = React.createClass({
renderTitle: function (props) {
var route = props.scene.route;
return <NavigationTitle route={route} />;
},
renderLeft: function(props) {
var route = props.scene.route;
var index = props.scene.index;
return <NavigationButton route={route} index={index} navigation={this.props.navigation} direction="left" />
},
renderRight: function(props) {
var route = props.scene.route;
var index = props.scene.index;
return <NavigationButton route={route} index={index} navigation={this.props.navigation} direction="right" />
},
render: function() {
return (
<NavigationHeader
{...this.props}
style={styles.header}
renderTitleComponent={this.renderTitle}
renderLeftComponent={this.renderLeft}
renderRightComponent={this.renderRight}
/>
);
}
});
var styles = StyleSheet.create({
appContainer: {
flex: 1
},
navBar: {
backgroundColor: cssVar('blue50'),
},
scene: {
flex: 1,
backgroundColor: cssVar('gray5'),
},
sceneHidden: {
marginTop: 0
},
header: {
backgroundColor: cssVar('blue50'),
borderBottomWidth: 0,
}
});
export default _NavigationHeader;