Created
June 5, 2020 02:38
-
-
Save whitesoundcl/f2689c15b1d4ff0b0902c692969f3b37 to your computer and use it in GitHub Desktop.
Boton de ejemplo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default class Button extends React.Component { | |
constructor(props) { | |
super(props); | |
} | |
render() { | |
return ( | |
<TouchableOpacity | |
onPress={ | |
!this.props.isActive | |
? () => {} | |
: this.props.onPress || (() => console.log('Accion no asignada')) | |
} | |
style={{ | |
...styles.container, | |
backgroundColor: this.props.isActive | |
? Colors.primary | |
: Colors.secondary, | |
}}> | |
<Text style={styles.label}> | |
{this.props.text || 'Texto de ejemplo'} | |
</Text> | |
</TouchableOpacity> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment