2019-07-23 14:02:57 +00:00
|
|
|
import { Alert } from 'react-native';
|
2020-02-10 14:53:42 +00:00
|
|
|
import I18n from '../i18n';
|
2018-01-15 20:43:52 +00:00
|
|
|
|
2019-06-21 16:38:26 +00:00
|
|
|
export const showErrorAlert = (message, title, onPress = () => {}) => Alert.alert(title, message, [{ text: 'OK', onPress }], { cancelable: true });
|
2020-02-10 14:53:42 +00:00
|
|
|
|
|
|
|
export const showConfirmationAlert = ({ message, callToAction, onPress }) => (
|
|
|
|
Alert.alert(
|
|
|
|
I18n.t('Are_you_sure_question_mark'),
|
|
|
|
message,
|
|
|
|
[
|
|
|
|
{
|
|
|
|
text: I18n.t('Cancel'),
|
|
|
|
style: 'cancel'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
text: callToAction,
|
|
|
|
style: 'destructive',
|
|
|
|
onPress
|
|
|
|
}
|
|
|
|
],
|
|
|
|
{ cancelable: false }
|
|
|
|
)
|
|
|
|
);
|