Aucune description

Btn.js 610B

123456789101112131415161718192021222324252627282930
  1. //@flow
  2. import React, { Component } from 'react';
  3. import { Text, TouchableOpacity, StyleSheet } from 'react-native';
  4. const styles = StyleSheet.create({
  5. root: {
  6. margin: 3,
  7. paddingVertical: 4,
  8. paddingHorizontal: 8,
  9. color: '#36f',
  10. borderWidth: 1,
  11. borderColor: '#36f',
  12. fontSize: 12,
  13. },
  14. });
  15. export default class Btn extends Component<{
  16. onPress: () => void,
  17. label: string,
  18. }> {
  19. render() {
  20. const { onPress, label } = this.props;
  21. return (
  22. <TouchableOpacity onPress={onPress}>
  23. <Text style={styles.root}>{label}</Text>
  24. </TouchableOpacity>
  25. );
  26. }
  27. }