Button.js 692 B

123456789101112131415161718192021222324252627282930
  1. import React from 'react'
  2. import { StyleSheet, Text } from 'react-native'
  3. import Touchable from './Touchable'
  4. export const Button = ({ title, children, style, textStyle, ...rest }) => (
  5. <Touchable style={[styles.button, style]} {...rest}>
  6. <Text style={[styles.text, textStyle]}>{title || children}</Text>
  7. </Touchable>
  8. )
  9. const styles = StyleSheet.create({
  10. button: {
  11. paddingVertical: 6,
  12. paddingHorizontal: 12,
  13. borderRadius: 3,
  14. backgroundColor: '#fff',
  15. alignItems: 'center',
  16. justifyContent: 'center',
  17. borderColor: '#037aff',
  18. borderWidth: StyleSheet.hairlineWidth,
  19. },
  20. text: {
  21. fontSize: 16,
  22. color: '#037aff',
  23. },
  24. })
  25. export default Button