mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 04:16:00 +08:00
inline a bunch of NativeModule requires
Reviewed By: shergin Differential Revision: D4578180 fbshipit-source-id: 3764ffd32eb7e4698e928740bc72bbad02876894
This commit is contained in:
committed by
Facebook Github Bot
parent
dc0df40770
commit
1fa95ed390
@@ -11,9 +11,9 @@
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
var AlertIOS = require('AlertIOS');
|
||||
var Platform = require('Platform');
|
||||
var DialogModuleAndroid = require('NativeModules').DialogManagerAndroid;
|
||||
const AlertIOS = require('AlertIOS');
|
||||
const NativeModules = require('NativeModules');
|
||||
const Platform = require('Platform');
|
||||
|
||||
import type { AlertType, AlertButtonStyle } from 'AlertIOS';
|
||||
|
||||
@@ -127,18 +127,18 @@ class AlertAndroid {
|
||||
if (buttonPositive) {
|
||||
config = {...config, buttonPositive: buttonPositive.text || '' };
|
||||
}
|
||||
DialogModuleAndroid.showAlert(
|
||||
NativeModules.DialogModuleAndroid.showAlert(
|
||||
config,
|
||||
(errorMessage) => console.warn(errorMessage),
|
||||
(action, buttonKey) => {
|
||||
if (action !== DialogModuleAndroid.buttonClicked) {
|
||||
if (action !== NativeModules.DialogModuleAndroid.buttonClicked) {
|
||||
return;
|
||||
}
|
||||
if (buttonKey === DialogModuleAndroid.buttonNeutral) {
|
||||
if (buttonKey === NativeModules.DialogModuleAndroid.buttonNeutral) {
|
||||
buttonNeutral.onPress && buttonNeutral.onPress();
|
||||
} else if (buttonKey === DialogModuleAndroid.buttonNegative) {
|
||||
} else if (buttonKey === NativeModules.DialogModuleAndroid.buttonNegative) {
|
||||
buttonNegative.onPress && buttonNegative.onPress();
|
||||
} else if (buttonKey === DialogModuleAndroid.buttonPositive) {
|
||||
} else if (buttonKey === NativeModules.DialogModuleAndroid.buttonPositive) {
|
||||
buttonPositive.onPress && buttonPositive.onPress();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user