dhre-ui-kit 0.0.329 → 0.0.330
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +0 -24
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +0 -23
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -2
package/lib/index.mjs
CHANGED
|
@@ -15,7 +15,6 @@ import { TextInput as TextInput$1 } from 'react-native-paper';
|
|
|
15
15
|
import { Dropdown } from 'react-native-element-dropdown';
|
|
16
16
|
import DocumentPicker from 'react-native-document-picker';
|
|
17
17
|
import RNFS from 'react-native-fs';
|
|
18
|
-
import OTPVerify, { removeListener, startOtpListener } from 'react-native-otp-verify';
|
|
19
18
|
|
|
20
19
|
var ShapeType = /* @__PURE__ */ ((ShapeType2) => {
|
|
21
20
|
ShapeType2["LINE"] = "line";
|
|
@@ -4117,28 +4116,6 @@ const OTPInput = React.forwardRef(
|
|
|
4117
4116
|
setTimeLeft(timerToResend / 1e3);
|
|
4118
4117
|
}, timerToResend);
|
|
4119
4118
|
};
|
|
4120
|
-
useEffect(() => {
|
|
4121
|
-
if (Platform.OS === "android") {
|
|
4122
|
-
onStartListeningOtp();
|
|
4123
|
-
}
|
|
4124
|
-
return () => {
|
|
4125
|
-
if (Platform.OS === "android") {
|
|
4126
|
-
OTPVerify.removeListener();
|
|
4127
|
-
removeListener();
|
|
4128
|
-
}
|
|
4129
|
-
};
|
|
4130
|
-
}, []);
|
|
4131
|
-
const onStartListeningOtp = async () => {
|
|
4132
|
-
await OTPVerify.getOtp();
|
|
4133
|
-
startOtpListener((message) => {
|
|
4134
|
-
const otpRegex = new RegExp(`(\\d{${length}})`, "g");
|
|
4135
|
-
const otp2 = otpRegex.exec(message)?.[1];
|
|
4136
|
-
setOTP(otp2 ?? "");
|
|
4137
|
-
if (otp2) {
|
|
4138
|
-
refs.current[otp2?.length - 1]?.focus();
|
|
4139
|
-
}
|
|
4140
|
-
});
|
|
4141
|
-
};
|
|
4142
4119
|
React.useImperativeHandle(ref, () => ({
|
|
4143
4120
|
reset() {
|
|
4144
4121
|
setOTP("");
|