dhre-ui-kit 0.0.236 → 0.0.238

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 CHANGED
@@ -787,17 +787,21 @@ const CustomLoader = ({ loading, loadingText = "Loading..." }) => {
787
787
  React.useEffect(() => {
788
788
  if (loading) {
789
789
  reactNative.Animated.loop(
790
- reactNative.Animated.parallel([
791
- reactNative.Animated.timing(rotateAnim, {
792
- toValue: 1,
793
- duration: 1500,
794
- easing: reactNative.Easing.linear,
795
- useNativeDriver: true
796
- })
797
- ])
790
+ reactNative.Animated.timing(rotateAnim, {
791
+ toValue: 1,
792
+ duration: 1500,
793
+ easing: reactNative.Easing.linear,
794
+ useNativeDriver: true
795
+ })
798
796
  ).start();
797
+ } else {
798
+ rotateAnim.stopAnimation();
799
+ rotateAnim.setValue(0);
799
800
  }
800
- }, [loading]);
801
+ return () => {
802
+ rotateAnim.stopAnimation();
803
+ };
804
+ }, [loading, rotateAnim]);
801
805
  if (!loading) return null;
802
806
  const spin = rotateAnim.interpolate({
803
807
  inputRange: [0, 1],
@@ -4452,23 +4456,26 @@ const CustomSlideButton = React__default["default"].forwardRef(
4452
4456
  };
4453
4457
  const panResponder = reactNative.PanResponder.create({
4454
4458
  onMoveShouldSetPanResponder: (e, gestureState) => {
4455
- return Math.abs(gestureState.dx) > Math.abs(gestureState.dy);
4459
+ return gestureState.dx !== 0;
4456
4460
  },
4457
4461
  onPanResponderMove: (evt, gestureState) => {
4458
- translateX.setValue(gestureState.dx);
4459
- slideTailCardRef?.current?.setNativeProps({
4460
- style: { width: gestureState.dx + BUTTON_WIDTH / 2 }
4461
- });
4462
+ if (gestureState.dx > 0) {
4463
+ translateX.setValue(gestureState.dx);
4464
+ slideTailCardRef?.current?.setNativeProps({
4465
+ style: { width: gestureState.dx + BUTTON_WIDTH / 2 }
4466
+ });
4467
+ }
4462
4468
  },
4463
4469
  onPanResponderRelease: (e, gestureState) => {
4464
- if (gestureState.dx >= value.current * 0.8) {
4465
- onComplete?.();
4470
+ if (gestureState.dx >= value.current * 0.7) {
4466
4471
  reactNative.Animated.timing(translateX, {
4467
- toValue: value.current - BUTTON_WIDTH,
4472
+ toValue: value.current - BUTTON_WIDTH - 12,
4468
4473
  // Slide to the end
4469
4474
  duration: 300,
4470
4475
  useNativeDriver: false
4471
- }).start();
4476
+ }).start(() => {
4477
+ onComplete?.();
4478
+ });
4472
4479
  slideTailCardRef?.current?.setNativeProps({
4473
4480
  style: { width: value.current + BUTTON_WIDTH }
4474
4481
  // Change the width here