@oxyhq/services
Version:
Reusable OxyHQ module to handle authentication, user management, karma system, device-based session management and more 🚀
28 lines (27 loc) • 707 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.confirmAction = confirmAction;
var _reactNative = require("react-native");
/**
* Cross-platform confirm dialog. Uses window.confirm on web, Alert.alert on native.
* @param message The message to display
* @param onConfirm Callback if user confirms
*/
function confirmAction(message, onConfirm) {
if (_reactNative.Platform.OS === 'web') {
if (window.confirm(message)) {
onConfirm();
}
} else {
_reactNative.Alert.alert('Confirm', message, [{
text: 'Cancel',
style: 'cancel'
}, {
text: 'OK',
onPress: onConfirm
}]);
}
}
//# sourceMappingURL=confirmAction.js.map