@teamnhz/rn-ui-toolkit 1.1.3 → 1.1.5
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/dist/components/Image/index.js +16 -21
- package/package.json +1 -1
|
@@ -1,24 +1,19 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import { ActivityIndicator } from "react-native";
|
|
3
|
-
import FastImage from "react-native-fast-image";
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Image as RNImage, ActivityIndicator, View, StyleSheet } from "react-native";
|
|
4
3
|
const Image = (props) => {
|
|
5
|
-
const
|
|
6
|
-
return (React.createElement(
|
|
7
|
-
React.createElement(
|
|
8
|
-
|
|
9
|
-
}, onLoadEnd: () => {
|
|
10
|
-
setLoading(false);
|
|
11
|
-
}, resizeMode: props.resizeMode }, loading ? (React.createElement(ActivityIndicator, { style: {
|
|
12
|
-
position: "absolute",
|
|
13
|
-
alignSelf: "center",
|
|
14
|
-
top: 0,
|
|
15
|
-
bottom: 0,
|
|
16
|
-
}, size: props.loaderSize || "small", color: props.loaderColor || "#919191" })) : null)));
|
|
4
|
+
const { isLoading, loaderSize = "small", loaderColor = "#919191", style, ...rest } = props;
|
|
5
|
+
return (React.createElement(View, { style: [styles.container, style] },
|
|
6
|
+
React.createElement(RNImage, { ...rest, style: [StyleSheet.absoluteFill, style], resizeMode: props.resizeMode || "cover" }),
|
|
7
|
+
isLoading && (React.createElement(ActivityIndicator, { style: styles.loader, size: loaderSize, color: loaderColor }))));
|
|
17
8
|
};
|
|
9
|
+
const styles = StyleSheet.create({
|
|
10
|
+
container: {
|
|
11
|
+
justifyContent: "center",
|
|
12
|
+
alignItems: "center",
|
|
13
|
+
overflow: "hidden",
|
|
14
|
+
},
|
|
15
|
+
loader: {
|
|
16
|
+
position: "absolute",
|
|
17
|
+
},
|
|
18
|
+
});
|
|
18
19
|
export default Image;
|
|
19
|
-
// import React from 'react';
|
|
20
|
-
// import FastImage from 'react-native-fast-image';
|
|
21
|
-
// const Image = ({ ...props }) => {
|
|
22
|
-
// return <FastImage {...props} />;
|
|
23
|
-
// };
|
|
24
|
-
// export default Image;
|