-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
55 lines (46 loc) · 1.27 KB
/
index.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
/* @flow */
'use strict';
var React = require('react-native');
var {
Text,
TouchableOpacity,
View,
} = React;
var ReactART = require('react-native/Libraries/ART/ReactNativeART');
var {
Group,
Surface,
Shape,
} = ReactART;
var ARROW_PATH = "M 0.5,21 L 22,42 26,38 9,21 26,4 22,-0 0.5,21 Z M 0.5,21";
class LeftNavigationButton extends React.Component {
render() {
var [ow, oh] = [26, 42];
var {width, height, ...innerStyle} = {
width: 13,
height: 21,
alignItems: 'center',
paddingLeft: 8,
flexDirection: 'row',
...this.props.style};
return (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'flex-start' }}>
<TouchableOpacity onPress={this.props.onPress}>
<View style={innerStyle}>
<Surface width={width} height={height}>
<Group scaleX={width / ow} scaleY={height / oh}>
<Shape fill="#3d71ff" d={ARROW_PATH} />
</Group>
</Surface>
<Text numberOfLines={1} style={{ width: 112, fontSize: 17, color: '#3d71ff', paddingLeft: 6, top: -0.25 }}>
{this.props.title}
</Text>
</View>
</TouchableOpacity>
</View>
)
}
}
module.exports = {
LeftNavigationButton,
};