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.mjs
CHANGED
|
@@ -744,24 +744,27 @@ const createStyles$3 = (theme) => {
|
|
|
744
744
|
});
|
|
745
745
|
};
|
|
746
746
|
|
|
747
|
-
const CustomLoader = ({
|
|
747
|
+
const CustomLoader = ({
|
|
748
|
+
loading,
|
|
749
|
+
loadingText = "Loading..."
|
|
750
|
+
}) => {
|
|
748
751
|
const rotateAnim = useRef(new Animated.Value(0)).current;
|
|
749
752
|
const { theme, mode } = useTheme();
|
|
750
753
|
const styles = createStyles$3(theme);
|
|
751
754
|
useEffect(() => {
|
|
752
755
|
if (loading) {
|
|
753
756
|
Animated.loop(
|
|
754
|
-
Animated.
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
})
|
|
761
|
-
])
|
|
757
|
+
Animated.timing(rotateAnim, {
|
|
758
|
+
toValue: 1,
|
|
759
|
+
duration: 1500,
|
|
760
|
+
easing: Easing.linear,
|
|
761
|
+
useNativeDriver: true
|
|
762
|
+
})
|
|
762
763
|
).start();
|
|
764
|
+
} else {
|
|
765
|
+
rotateAnim.setValue(0);
|
|
763
766
|
}
|
|
764
|
-
}, [loading]);
|
|
767
|
+
}, [loading, rotateAnim]);
|
|
765
768
|
if (!loading) return null;
|
|
766
769
|
const spin = rotateAnim.interpolate({
|
|
767
770
|
inputRange: [0, 1],
|