added image delete confirmation alert

This commit is contained in:
Nouman Tahir 2021-04-06 01:37:03 +05:00
parent b014d94a31
commit 0d8cb3106e
2 changed files with 20 additions and 2 deletions

View File

@ -116,7 +116,21 @@ export const UploadsGalleryModal = forwardRef(({username, handleOnSelect, handl
}
const _onRemovePress = async () => {
_deleteMediaItem(item._id)
const _onConfirm = () => {
_deleteMediaItem(item._id)
}
Alert.alert(
intl.formatMessage({id:'uploads_modal.alert_remove_title'}),
intl.formatMessage({id:'uploads_modal.alert_remove_body'}),
[{
text:intl.formatMessage({id:'uploads_modal.alert_btn_no'}),
style:'cancel'
},{
text:intl.formatMessage({id:'uploads_modal.alert_btn_yes'}),
onPress:_onConfirm
}]
)
}
const thumbUrl = proxifyImageSrc(item.url, 600, 500, Platform.OS === 'ios' ? 'match' : 'webp');

View File

@ -337,7 +337,11 @@
"title_remove_confirmation":"Delete image",
"btn_add":"Image",
"message_failed":"Failed to upload image",
"message_remove_confirmation":"Are you sure you want to delete this image?"
"message_remove_confirmation":"Are you sure you want to delete this image?",
"alert_remove_title":"Confirm Delete",
"alert_remove_body":"Are you sure you wish to delete this image?",
"alert_btn_yes":"Yes",
"alert_btn_no":"No"
},
"pincode": {
"enter_text": "Enter PIN to unlock",