UNPKG

react-native-starter-provider

Version:
37 lines (33 loc) 794 B
import React from 'react'; import PropTypes from 'prop-types'; import Text from '../Text'; import styles from './styles'; const Button = ({ textColor, weight, translation, style, textSize, onPress, children, }) => ( <TouchableOpacity style={[styles.container, style]} onPress={onPress}> <Text size={textSize} color={textColor} weight={weight} translation={translation} /> </TouchableOpacity> ); Button.propTypes = { textColor: PropTypes.string, weight: PropTypes.string, translation: PropTypes.string, onPress: PropTypes.func, textSize: PropTypes.number, style: PropTypes.any, }; Button.defaultProps = { textColor: 'white', weight: 'MEDIUM', translation: '', onPress: () => {}, textSize: 16, style: [], }; export default Button;