import { Alert, Linking } from 'react-native'; import BaseFunc from '../base/func' export default class PlusCommonWidget { static msgAlert(sMessage: string, sTitle?: string, fOk?: Function) { Alert.alert( sTitle ? sTitle : '', sMessage, [ //{text: 'Ask me later', onPress: () => console.log('Ask me later pressed')}, //{text: 'Cancel', onPress: () => console.log('Cancel Pressed'), style: 'cancel'}, { text: BaseFunc.upLang(12001), onPress: () => { if (fOk != undefined) { fOk() } } }, ] ) } static openUrl(sUrl) { Linking.openURL(sUrl).catch(err => { console.error('An error occurred', err); PlusCommonWidget.msgAlert(BaseFunc.upLang(12310)); } ); } }