dhre-ui-kit 0.0.235 → 0.0.237

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.d.ts CHANGED
@@ -713,6 +713,7 @@ interface IProps$1 {
713
713
  mode?: 'light' | 'dark';
714
714
  disabled?: boolean;
715
715
  maxResendCount?: number;
716
+ timerToResend?: number;
716
717
  }
717
718
  type OTPInputHandle = {
718
719
  reset?: () => void;
package/lib/index.js CHANGED
@@ -4026,7 +4026,8 @@ const OTPInput = React__default["default"].forwardRef(
4026
4026
  resendText = "Resend OTP",
4027
4027
  mode,
4028
4028
  disabled,
4029
- maxResendCount = 4
4029
+ maxResendCount = 4,
4030
+ timerToResend = 6e4
4030
4031
  }, ref) => {
4031
4032
  const [otp, setOTP] = React.useState("");
4032
4033
  const [isResendOtpEnable, setIsResendOtpEnable] = React.useState(false);
@@ -4049,9 +4050,8 @@ const OTPInput = React__default["default"].forwardRef(
4049
4050
  const onClickResendOTP = () => {
4050
4051
  if (resendOTPCount >= maxResendCount - 1) {
4051
4052
  setErrorMessageMaxReachCount("You have exceeded the maximum number of attempts.");
4052
- return;
4053
4053
  }
4054
- if (resendOTPCount < maxResendCount) {
4054
+ if (resendOTPCount <= maxResendCount) {
4055
4055
  setIsResendOtpEnable(false);
4056
4056
  setResendOTPCount(resendOTPCount + 1);
4057
4057
  enableResendOtp();
@@ -4069,7 +4069,7 @@ const OTPInput = React__default["default"].forwardRef(
4069
4069
  const enableResendOtp = () => {
4070
4070
  setTimeout(() => {
4071
4071
  setIsResendOtpEnable(true);
4072
- }, 6e4);
4072
+ }, timerToResend);
4073
4073
  };
4074
4074
  React.useEffect(() => {
4075
4075
  if (reactNative.Platform.OS === "android") {
@@ -4452,23 +4452,26 @@ const CustomSlideButton = React__default["default"].forwardRef(
4452
4452
  };
4453
4453
  const panResponder = reactNative.PanResponder.create({
4454
4454
  onMoveShouldSetPanResponder: (e, gestureState) => {
4455
- return Math.abs(gestureState.dx) > Math.abs(gestureState.dy);
4455
+ return gestureState.dx !== 0;
4456
4456
  },
4457
4457
  onPanResponderMove: (evt, gestureState) => {
4458
- translateX.setValue(gestureState.dx);
4459
- slideTailCardRef?.current?.setNativeProps({
4460
- style: { width: gestureState.dx + BUTTON_WIDTH / 2 }
4461
- });
4458
+ if (gestureState.dx > 0) {
4459
+ translateX.setValue(gestureState.dx);
4460
+ slideTailCardRef?.current?.setNativeProps({
4461
+ style: { width: gestureState.dx + BUTTON_WIDTH / 2 }
4462
+ });
4463
+ }
4462
4464
  },
4463
4465
  onPanResponderRelease: (e, gestureState) => {
4464
- if (gestureState.dx >= value.current * 0.8) {
4465
- onComplete?.();
4466
+ if (gestureState.dx >= value.current * 0.7) {
4466
4467
  reactNative.Animated.timing(translateX, {
4467
- toValue: value.current - BUTTON_WIDTH,
4468
+ toValue: value.current - BUTTON_WIDTH - 12,
4468
4469
  // Slide to the end
4469
4470
  duration: 300,
4470
4471
  useNativeDriver: false
4471
- }).start();
4472
+ }).start(() => {
4473
+ onComplete?.();
4474
+ });
4472
4475
  slideTailCardRef?.current?.setNativeProps({
4473
4476
  style: { width: value.current + BUTTON_WIDTH }
4474
4477
  // Change the width here