Guest User

Untitled

a guest
Mar 23rd, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. import React, { Component } from 'react'
  2. import { TouchableOpacity, Text, ViewPropTypes } from 'react-native'
  3. import theme from '../../Theme'
  4. import PropTypes from 'prop-types'
  5.  
  6. class Button extends Component {
  7. render() {
  8. const { onPress, title, textStyle, buttonStyle, disabled } = this.props
  9. return (
  10. <TouchableOpacity
  11. style={[
  12. buttonStyle,
  13. {
  14. justifyContent: 'center',
  15. alignItems: 'center',
  16. flexDirection: 'row',
  17. backgroundColor: theme.colors.primary,
  18. marginLeft: 15,
  19. marginRight: 15,
  20. padding: 15
  21. }
  22. ]}
  23. disabled={disabled}
  24. onPress={onPress}
  25. >
  26. <Text style={textStyle}>{title}</Text>
  27. </TouchableOpacity>
  28. )
  29. }
  30. }
  31.  
  32. Button.defaultProps = {
  33. textStyle: {
  34. color: 'white',
  35. fontSize: 16
  36. },
  37. buttonStyle: ViewPropTypes.style
  38. }
  39.  
  40. export default Button
Add Comment
Please, Sign In to add comment