Skip to content

Instantly share code, notes, and snippets.

@thomashagstrom
Last active January 15, 2019 16:15
Show Gist options
  • Save thomashagstrom/d0b13889ff3ff44e08a8ead11a62f97a to your computer and use it in GitHub Desktop.
Save thomashagstrom/d0b13889ff3ff44e08a8ead11a62f97a to your computer and use it in GitHub Desktop.
CrossButton with child FontAwesome button
export class CrossButton extends React.Component<ICrossButtonProps> {
render() {
return (
<View style={this.props.style ? this.props.style : styles.container}>
{_.isNil(this.props.title) && !_.isNil(this.props.iconName) ? (
<FontAwesome.Button
testID="FontAwesomeButton"
onPress={() => {
if (this.props.onPress) {
this.props.onPress();
}
}}
name={this.props.iconName.toString()}
/>
) : null}
</View>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment