Guest User

Untitled

a guest
Dec 15th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  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. textStyle: {
  18. alignSelf: 'center',
  19. color: '#007aff',
  20. fontSize: 16,
  21. fontWeight: '600',
  22. paddingTop: 10,
  23. paddingBottom: 10
  24. },
  25. buttonStyle: {
  26. flex: 1,
  27. alignSelf: 'stretch',
  28. backgroundColor: '#fff',
  29. borderRadius: 5,
  30. borderWidth: 1,
  31. borderColor: '#007aff',
  32. marginLeft: 5,
  33. marginRight: 5
  34. }
  35. };
  36.  
  37. export default Button;
Add Comment
Please, Sign In to add comment