Skip to content

Instantly share code, notes, and snippets.

@hungdev
Created July 22, 2017 02:49
Show Gist options
  • Save hungdev/03813be2b65b08d8771d34182b717ac7 to your computer and use it in GitHub Desktop.
Save hungdev/03813be2b65b08d8771d34182b717ac7 to your computer and use it in GitHub Desktop.
alert React native
Alert.alert(
'Qubikal',
'Delete Image?',
[
{ text: 'No', onPress: () => console.log('Cancel Pressed'), style: 'cancel' },
{
text: 'Yes',
onPress: () => {
api.setToken(this.props.user.token)
api.deleteImage(this.props.image._id).then(response => {
console.log('deleteImage', response)
if (response.ok) {
this.props.onUpdate()
this.setState({ isShowModal: false })
}
})
}
}
],
{ cancelable: false }
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment