import * as React from "react" ; import { Text , TouchableOpacity } from "react-native" ; import ExamplesRegistry from "../../Services/ExamplesRegistry" ; import styles from "./RoundedButtonStyles" ; ExamplesRegistry . addComponentExample ( "Rounded Button" , ( ) => ( < RoundedButton text = "real buttons have curves" onPress = { ( ) => window . alert ( "Rounded Button Pressed!" ) } />)); interface Props { onPress ? : ( ) => any ; text ? : string ; children ? : string ; } const RoundedButton = ( { text , children , onPress = ( ) => { } } ) => { const buttonText = ( text || children || "" ) . toUpperCase ( ) ; return ( < TouchableOpacity style = { styles . button } onPress = { onPress } > < Text style = { styles . buttonText } > { buttonText } < /Text> < /TouchableOpacity>); } ; export default RoundedButton ;