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 +25 -18
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +25 -18
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
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.
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
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
|
-
|
|
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
|
|
4459
|
+
return gestureState.dx !== 0;
|
|
4456
4460
|
},
|
|
4457
4461
|
onPanResponderMove: (evt, gestureState) => {
|
|
4458
|
-
|
|
4459
|
-
|
|
4460
|
-
|
|
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.
|
|
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
|