Files
mobile/src/lib/alertManager.js
2017-10-02 10:16:48 -05:00

21 lines
489 B
JavaScript

import { Alert } from 'react-native';
import App from "../app"
export default class AlertManager {
static showConfirmationAlert(title, message, confirmationTitle, onConfirm, onCancel) {
// On iOS, confirm should go first. On Android, cancel should go first.
let buttons = [
{text: 'Cancel', onPress: onCancel},
{text: confirmationTitle, onPress: onConfirm},
];
Alert.alert(
title,
message,
buttons,
{ cancelable: true }
)
}
}