-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.js
More file actions
60 lines (55 loc) · 1.1 KB
/
index.js
File metadata and controls
60 lines (55 loc) · 1.1 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
/**
* Created by michaelmalura on 30/07/16.
*/
import React, {
PropTypes,
Component
} from 'react';
import {
Text,
TouchableHighlight
} from 'react-native';
import Style from './style';
class Button extends Component {
constructor(props) {
super(props);
}
render() {
return (
<TouchableHighlight style={[Style.button, this.props.buttonStyle]}
onPress={this.props.onPress}
underlayColor={'black'}>
<Text style={[Style.text, this.props.textStyle]}>{this.props.caption}</Text>
</TouchableHighlight>
)
}
}
Button.propTypes = {
icon : PropTypes.oneOfType([
PropTypes.string,
PropTypes.number,
PropTypes.object
]),
onPress : PropTypes.func.isRequired,
caption : PropTypes.oneOfType([
PropTypes.string,
PropTypes.number
]).isRequired,
buttonStyle: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number,
PropTypes.array,
PropTypes.object
]),
textStyle : PropTypes.oneOfType([
PropTypes.string,
PropTypes.number,
PropTypes.array,
PropTypes.object
]),
};
Button.defaultProps = {
color : 'black',
caption: 'Button'
};
export default Button;