@teamnhz/rn-ui-toolkit 1.2.5 → 1.2.7
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.
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
|
-
import { ActivityIndicator } from "react-native";
|
|
3
|
-
import FastImage from "@d11/react-native-fast-image";
|
|
2
|
+
import { ActivityIndicator, StyleSheet, View, Image as RNImage, } from "react-native";
|
|
4
3
|
const Image = (props) => {
|
|
5
|
-
const [isLoading, setIsLoading] = useState(
|
|
6
|
-
return (React.createElement(
|
|
7
|
-
React.createElement(
|
|
8
|
-
|
|
9
|
-
: null)));
|
|
4
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
5
|
+
return (React.createElement(View, { style: [styles.container, props.style] },
|
|
6
|
+
React.createElement(RNImage, { ...props, style: [StyleSheet.absoluteFill, props.style], resizeMode: props.resizeMode || "cover", onLoadStart: () => setIsLoading(true), onLoadEnd: () => setIsLoading(false), onError: () => setIsLoading(false) }),
|
|
7
|
+
isLoading && (React.createElement(ActivityIndicator, { size: props.loaderSize || "small", color: props.loaderColor || "#919191", style: styles.loader }))));
|
|
10
8
|
};
|
|
9
|
+
const styles = StyleSheet.create({
|
|
10
|
+
container: {
|
|
11
|
+
overflow: "hidden",
|
|
12
|
+
justifyContent: "center",
|
|
13
|
+
alignItems: "center",
|
|
14
|
+
},
|
|
15
|
+
loader: {
|
|
16
|
+
position: "absolute",
|
|
17
|
+
alignSelf: "center",
|
|
18
|
+
},
|
|
19
|
+
});
|
|
11
20
|
export default Image;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teamnhz/rn-ui-toolkit",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.7",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|
"react-native-date-picker": "^5.0.13",
|
|
21
21
|
"react-native-element-dropdown": "^2.12.4",
|
|
22
22
|
"react-native-elements": "^3.4.3",
|
|
23
|
-
"@d11/react-native-fast-image": "^8.12.0",
|
|
24
23
|
"react-native-gesture-handler": "^2.26.0",
|
|
25
24
|
"react-native-image-crop-picker": "^0.42.0",
|
|
26
25
|
"react-native-image-picker": "^8.2.0",
|