-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.js
67 lines (65 loc) · 1.76 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import {NativeModules} from "react-native";
const ProgressHUDMaskType = {
None: 1,
Clear: 2,
Black: 3
};
const {RNProgressHud} = NativeModules;
module.exports = {
ProgressHUDMaskType,
show(progressHUDMaskType) {
if (!progressHUDMaskType) {
return RNProgressHud.show();
}
return RNProgressHud.showWithMaskType(progressHUDMaskType);
},
showWithStatus(status, progressHUDMaskType) {
if (!progressHUDMaskType) {
return RNProgressHud.showWithStatus(status);
}
return RNProgressHud.showWithStatusAndMaskType(status, progressHUDMaskType);
},
showInfoWithStatus(status, progressHUDMaskType) {
if (!progressHUDMaskType) {
return RNProgressHud.showInfoWithStatus(status);
}
return RNProgressHud.showInfoWithStatusAndMaskType(
status,
progressHUDMaskType
);
},
showSuccessWithStatus(status, progressHUDMaskType) {
if (!progressHUDMaskType) {
return RNProgressHud.showSuccessWithStatus(status);
}
return RNProgressHud.showSuccessWithStatusAndMaskType(
status,
progressHUDMaskType
);
},
showErrorWithStatus(status, progressHUDMaskType) {
if (!progressHUDMaskType) {
return RNProgressHud.showErrorWithStatus(status);
}
return RNProgressHud.showErrorWithStatusAndMaskType(
status,
progressHUDMaskType
);
},
showProgressWithStatus(progress, status, progressHUDMaskType) {
if (!progressHUDMaskType) {
return RNProgressHud.showProgressWithStatus(progress, status);
}
return RNProgressHud.showProgressWithStatusAndMaskType(
progress,
status,
progressHUDMaskType
);
},
dismiss() {
RNProgressHud.dismiss();
},
dismissWithDelay(delayInSeconds) {
RNProgressHud.dismissWithDelay(delayInSeconds);
}
};