Created
July 22, 2017 02:49
-
-
Save hungdev/03813be2b65b08d8771d34182b717ac7 to your computer and use it in GitHub Desktop.
alert React native
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
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