Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React, { Component } from 'react'
- import { TouchableOpacity, Text, ViewPropTypes } from 'react-native'
- import theme from '../../Theme'
- import PropTypes from 'prop-types'
- class Button extends Component {
- render() {
- const { onPress, title, textStyle, buttonStyle, disabled } = this.props
- return (
- <TouchableOpacity
- style={[
- buttonStyle,
- {
- justifyContent: 'center',
- alignItems: 'center',
- flexDirection: 'row',
- backgroundColor: theme.colors.primary,
- marginLeft: 15,
- marginRight: 15,
- padding: 15
- }
- ]}
- disabled={disabled}
- onPress={onPress}
- >
- <Text style={textStyle}>{title}</Text>
- </TouchableOpacity>
- )
- }
- }
- Button.defaultProps = {
- textStyle: {
- color: 'white',
- fontSize: 16
- },
- buttonStyle: ViewPropTypes.style
- }
- export default Button
Add Comment
Please, Sign In to add comment