react-native-ui-lib 7.46.3-snapshot.7379 → 7.46.3-snapshot.7383
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/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-ui-lib",
|
|
3
|
-
"version": "7.46.3-snapshot.
|
|
3
|
+
"version": "7.46.3-snapshot.7383",
|
|
4
4
|
"main": "src/index.js",
|
|
5
5
|
"types": "src/index.d.ts",
|
|
6
6
|
"author": "Ethan Sharabi <ethan.shar@gmail.com>",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"url": "https://github.com/wix/react-native-ui-lib"
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
17
|
-
"start": "watchman watch-del-all && react-native start",
|
|
17
|
+
"start": "watchman watch-del-all && react-native start --client-logs",
|
|
18
18
|
"start:web": "npm --prefix webDemo run start",
|
|
19
19
|
"ios": "react-native run-ios",
|
|
20
20
|
"android": "react-native run-android",
|
|
@@ -5,6 +5,7 @@ import Animated, { useSharedValue, useAnimatedStyle, withTiming } from 'react-na
|
|
|
5
5
|
import View from "../../components/view";
|
|
6
6
|
import Image from "../../components/image";
|
|
7
7
|
import { useDidUpdate } from "../../hooks";
|
|
8
|
+
import Constants from "../../commons/Constants";
|
|
8
9
|
const UIAnimatedImage = Animated.createAnimatedComponent(Image);
|
|
9
10
|
/**
|
|
10
11
|
* @description: Image component that fades-in the image with animation once it's loaded
|
|
@@ -32,8 +33,10 @@ const AnimatedImage = props => {
|
|
|
32
33
|
}
|
|
33
34
|
}, [loader]);
|
|
34
35
|
useEffect(() => {
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
if (Constants.isIOS) {
|
|
37
|
+
setIsLoading(true);
|
|
38
|
+
propsOnLoadStart?.();
|
|
39
|
+
}
|
|
37
40
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
38
41
|
}, [source]);
|
|
39
42
|
const onLoad = useCallback(event => {
|
|
@@ -50,11 +53,10 @@ const AnimatedImage = props => {
|
|
|
50
53
|
[setIsLoading, propsOnLoad, animationDuration]);
|
|
51
54
|
|
|
52
55
|
// TODO: RN 77 - revert to this solution when iOS is fixed in future RN releases
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
const onLoadStart = useCallback(() => {
|
|
57
|
+
setIsLoading(true);
|
|
58
|
+
propsOnLoadStart?.();
|
|
59
|
+
}, [setIsLoading, propsOnLoadStart, animationDuration]);
|
|
58
60
|
const fadeInStyle = useAnimatedStyle(() => {
|
|
59
61
|
return {
|
|
60
62
|
opacity: opacity.value
|
|
@@ -64,9 +66,7 @@ const AnimatedImage = props => {
|
|
|
64
66
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
65
67
|
const _style = useMemo(() => [style, fadeInStyle], [style]);
|
|
66
68
|
return <View style={containerStyle}>
|
|
67
|
-
<UIAnimatedImage {...others} style={_style} source={source} onLoad={onLoad}
|
|
68
|
-
// onLoadStart={onLoadStart}
|
|
69
|
-
testID={testID} imageStyle={undefined} />
|
|
69
|
+
<UIAnimatedImage {...others} style={_style} source={source} onLoad={onLoad} onLoadStart={Constants.isAndroid ? onLoadStart : undefined} testID={testID} imageStyle={undefined} />
|
|
70
70
|
{isLoading && loader && <View style={styles.loader}>{loader}</View>}
|
|
71
71
|
</View>;
|
|
72
72
|
};
|