Advertisement
Guest User

Button.js

a guest
May 25th, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import React from 'react';
  2. import { Text, TouchableOpacity } from 'react-native';
  3.  
  4. const Button = ({ onPress, children }) => {
  5.     const { buttonStyle, textStyle } = styles;
  6.    
  7.     return (
  8.         <TouchableOpacity onPress={onPress} style={buttonStyle}>
  9.             <Text style={textStyle}>
  10.                 {children}
  11.             </Text>
  12.         </TouchableOpacity>
  13.     );
  14. };
  15.  
  16. const styles = {
  17.     buttonStyle: {
  18.         flex: 1,
  19.         alignSelf: 'stretch',
  20.         backgroundColor: '#fff',
  21.         borderRadius: 5,
  22.         borderWidth: 1,
  23.         borderColor: '#007aff',
  24.         marginLeft: 5,
  25.         marginRight: 5
  26.     },
  27.     textStyle: {
  28.         alignSelf: 'center',
  29.         color: '#007aff',
  30.         fontSize: 16,
  31.         fontWeight: '600',
  32.         paddingTop: 10,
  33.         paddingBottom: 10
  34.     }
  35. };
  36.  
  37.  
  38. export { Button };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement