Rocket.Chat.ReactNative/app/utils/info.js

24 lines
530 B
JavaScript
Raw Normal View History

2019-07-23 14:02:57 +00:00
import { Alert } from 'react-native';
import I18n from '../i18n';
2018-01-15 20:43:52 +00:00
export const showErrorAlert = (message, title, onPress = () => {}) => Alert.alert(title, message, [{ text: 'OK', onPress }], { cancelable: true });
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 }
)
);