UNPKG

ignite-jhipster

Version:

A React Native boilerplate for JHipster apps.

28 lines (24 loc) 757 B
import React from 'react' import PropTypes from 'prop-types' import { TouchableOpacity, Text } from 'react-native' import styles from './rounded-button.styles' export default class RoundedButton extends React.Component { static propTypes = { onPress: PropTypes.func, text: PropTypes.string, children: PropTypes.string, navigator: PropTypes.object, testID: PropTypes.string } getText () { const buttonText = this.props.text || this.props.children || '' return buttonText.toUpperCase() } render () { return ( <TouchableOpacity testID={this.props.testID} style={styles.button} onPress={this.props.onPress}> <Text style={styles.buttonText}>{this.getText()}</Text> </TouchableOpacity> ) } }