Skip to content

Instantly share code, notes, and snippets.

@whitesoundcl
Created June 5, 2020 02:38
Show Gist options
  • Save whitesoundcl/f2689c15b1d4ff0b0902c692969f3b37 to your computer and use it in GitHub Desktop.
Save whitesoundcl/f2689c15b1d4ff0b0902c692969f3b37 to your computer and use it in GitHub Desktop.
Boton de ejemplo
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