-
Notifications
You must be signed in to change notification settings - Fork 627
/
MenuItem.js
39 lines (36 loc) 路 951 Bytes
/
MenuItem.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
import {createElement, Component} from 'rax';
import Text from 'rax-text';
import TouchableHighlight from 'rax-touchable';
import View from 'rax-view';
import StyleSheet from 'universal-stylesheet';
export default class MenuItem extends Component {
render() {
const {title, titleStyle, onPress, style, children} = this.props;
const content = children ? children : (
<Text style={[menuItemStyle.text, titleStyle]}>{title}</Text>
);
return (
<TouchableHighlight
style={[menuItemStyle.item, style]}
onPress={onPress}
>
{content}
</TouchableHighlight>
);
}
}
const menuItemStyle = StyleSheet.create({
item: {
backgroundColor: '#ffffff',
justifyContent: 'center',
alignItems: 'center',
borderColor: '#e7e7e7',
borderBottomWidth: StyleSheet.hairlineWidth,
paddingTop: 15,
paddingBottom: 15
},
text: {
fontSize: 28,
color: '#666666'
}
});