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.mjs CHANGED
@@ -3990,7 +3990,8 @@ const OTPInput = React.forwardRef(
3990
3990
  resendText = "Resend OTP",
3991
3991
  mode,
3992
3992
  disabled,
3993
- maxResendCount = 4
3993
+ maxResendCount = 4,
3994
+ timerToResend = 6e4
3994
3995
  }, ref) => {
3995
3996
  const [otp, setOTP] = useState("");
3996
3997
  const [isResendOtpEnable, setIsResendOtpEnable] = useState(false);
@@ -4013,9 +4014,8 @@ const OTPInput = React.forwardRef(
4013
4014
  const onClickResendOTP = () => {
4014
4015
  if (resendOTPCount >= maxResendCount - 1) {
4015
4016
  setErrorMessageMaxReachCount("You have exceeded the maximum number of attempts.");
4016
- return;
4017
4017
  }
4018
- if (resendOTPCount < maxResendCount) {
4018
+ if (resendOTPCount <= maxResendCount) {
4019
4019
  setIsResendOtpEnable(false);
4020
4020
  setResendOTPCount(resendOTPCount + 1);
4021
4021
  enableResendOtp();
@@ -4033,7 +4033,7 @@ const OTPInput = React.forwardRef(
4033
4033
  const enableResendOtp = () => {
4034
4034
  setTimeout(() => {
4035
4035
  setIsResendOtpEnable(true);
4036
- }, 6e4);
4036
+ }, timerToResend);
4037
4037
  };
4038
4038
  useEffect(() => {
4039
4039
  if (Platform.OS === "android") {
@@ -4416,23 +4416,26 @@ const CustomSlideButton = React.forwardRef(
4416
4416
  };
4417
4417
  const panResponder = PanResponder.create({
4418
4418
  onMoveShouldSetPanResponder: (e, gestureState) => {
4419
- return Math.abs(gestureState.dx) > Math.abs(gestureState.dy);
4419
+ return gestureState.dx !== 0;
4420
4420
  },
4421
4421
  onPanResponderMove: (evt, gestureState) => {
4422
- translateX.setValue(gestureState.dx);
4423
- slideTailCardRef?.current?.setNativeProps({
4424
- style: { width: gestureState.dx + BUTTON_WIDTH / 2 }
4425
- });
4422
+ if (gestureState.dx > 0) {
4423
+ translateX.setValue(gestureState.dx);
4424
+ slideTailCardRef?.current?.setNativeProps({
4425
+ style: { width: gestureState.dx + BUTTON_WIDTH / 2 }
4426
+ });
4427
+ }
4426
4428
  },
4427
4429
  onPanResponderRelease: (e, gestureState) => {
4428
- if (gestureState.dx >= value.current * 0.8) {
4429
- onComplete?.();
4430
+ if (gestureState.dx >= value.current * 0.7) {
4430
4431
  Animated.timing(translateX, {
4431
- toValue: value.current - BUTTON_WIDTH,
4432
+ toValue: value.current - BUTTON_WIDTH - 12,
4432
4433
  // Slide to the end
4433
4434
  duration: 300,
4434
4435
  useNativeDriver: false
4435
- }).start();
4436
+ }).start(() => {
4437
+ onComplete?.();
4438
+ });
4436
4439
  slideTailCardRef?.current?.setNativeProps({
4437
4440
  style: { width: value.current + BUTTON_WIDTH }
4438
4441
  // Change the width here