12345678910111213141516171819202122232425262728293031323334353637383940 |
- //@flow
- import React, {
- Component,
- PropTypes,
- } from "react";
- 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>
- );
- }
- }
|