forked from gre/react-native-view-shot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBtn.js
31 lines (29 loc) · 706 Bytes
/
Btn.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
//@flow
import React, { Component } from "react";
import PropTypes from "prop-types";
import { Text, TouchableOpacity, StyleSheet } from "react-native";
const styles = StyleSheet.create({
root: {
margin: 3,
paddingVertical: 4,
paddingHorizontal: 8,
color: "#36f",
borderWidth: 1,
borderColor: "#36f",
fontSize: 12
}
});
export default class Btn extends Component {
static propTypes = {
onPress: PropTypes.func.isRequired,
label: PropTypes.string.isRequired
};
render() {
const { onPress, label } = this.props;
return (
<TouchableOpacity onPress={onPress}>
<Text style={styles.root}>{label}</Text>
</TouchableOpacity>
);
}
}