react-native-template-team-isl
Version:
Boilarplate by team-isl!
20 lines (17 loc) • 606 B
text/typescript
import { Platform, Alert } from 'react-native';
import { name as appName } from '../../app.json';
export const APP_TITLE = appName;
export const isIOS = Platform.OS === 'ios';
export const pop_withmsg = async (msg: string, title = APP_TITLE) => {
Alert.alert(title, msg);
};
export const pop_withAction = async (title: string, msg: string, callback = (result: boolean) => { }) => {
Alert.alert(title, msg, [
{
text: 'Cancel',
onPress: () => callback(false),
style: 'cancel',
},
{ text: 'OK', onPress: () => callback(true) },
]);
};