dhre-ui-kit 0.0.237 → 0.0.239
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 +13 -10
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +13 -10
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -780,24 +780,27 @@ const createStyles$3 = (theme) => {
|
|
|
780
780
|
});
|
|
781
781
|
};
|
|
782
782
|
|
|
783
|
-
const CustomLoader = ({
|
|
783
|
+
const CustomLoader = ({
|
|
784
|
+
loading,
|
|
785
|
+
loadingText = "Loading..."
|
|
786
|
+
}) => {
|
|
784
787
|
const rotateAnim = React.useRef(new reactNative.Animated.Value(0)).current;
|
|
785
788
|
const { theme, mode } = useTheme();
|
|
786
789
|
const styles = createStyles$3(theme);
|
|
787
790
|
React.useEffect(() => {
|
|
788
791
|
if (loading) {
|
|
789
792
|
reactNative.Animated.loop(
|
|
790
|
-
reactNative.Animated.
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
})
|
|
797
|
-
])
|
|
793
|
+
reactNative.Animated.timing(rotateAnim, {
|
|
794
|
+
toValue: 1,
|
|
795
|
+
duration: 1500,
|
|
796
|
+
easing: reactNative.Easing.linear,
|
|
797
|
+
useNativeDriver: true
|
|
798
|
+
})
|
|
798
799
|
).start();
|
|
800
|
+
} else {
|
|
801
|
+
rotateAnim.setValue(0);
|
|
799
802
|
}
|
|
800
|
-
}, [loading]);
|
|
803
|
+
}, [loading, rotateAnim]);
|
|
801
804
|
if (!loading) return null;
|
|
802
805
|
const spin = rotateAnim.interpolate({
|
|
803
806
|
inputRange: [0, 1],
|