forked from cmsapp/todont
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TDButton.js
41 lines (36 loc) · 953 Bytes
/
TDButton.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
var React = require('react-native');
var colors = require('./colors');
var { Text, TouchableHighlight, StyleSheet } = React;
var styles = {
container: {
height: 35,
backgroundColor: colors.primary,
alignSelf: 'stretch',
justifyContent: 'center',
margin: 10,
borderColor: colors.primary,
borderWidth: 1,
borderRadius: 8
},
text: {
fontSize: 16,
color: 'white',
alignSelf: 'center'
}
}
class TDButton extends React.Component {
render() {
var underlayColor = this.props.underlayColor || 'rgb(63, 113, 195)';
var touchableHighlightStyle = Object.assign({}, styles.container, this.props.containerStyle);
return(
<TouchableHighlight
style={touchableHighlightStyle}
underlayColor={underlayColor}
onPress={this.props.onPress}
>
<Text style={styles.text}>{this.props.text}</Text>
</TouchableHighlight>
);
}
}
module.exports = TDButton;