Aleart.js 653 Bytes
Newer Older
Giang Tran committed
1
import {Alert} from 'react-native';
Giang Tran committed
2
import I18n from '../helper/i18/i18n';
Giang Tran committed
3 4

export const NotificationAlert = (string) => {
5
    Alert.alert(I18n.t('Notification'), string);
Giang Tran committed
6 7
};

8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
export const confirmAlert = (content, callback, positiveTitle) => {
    Alert.alert(
        I18n.t('Notification'),
        content,
        [
            {
                text: I18n.t('Cancel'),
                style: 'cancel',
            },
            {
                text: positiveTitle ? positiveTitle : I18n.t('Ok'),
                onPress: () => {
                    callback();
                },
            },
        ],
        {cancelable: false},
    );
Giang Tran committed
26
};