@momo-kits/foundation 0.103.2-beta.3 → 0.103.2-beta.4
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/Image/index.tsx +2 -15
- package/Loader/DotLoader.tsx +2 -2
- package/Loader/Spinner.tsx +2 -2
- package/package.json +1 -1
package/Image/index.tsx
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import React, {useContext,
|
|
1
|
+
import React, {useContext, useRef, useState} from 'react';
|
|
2
2
|
import {StyleSheet, View} from 'react-native';
|
|
3
3
|
import FastImage, {Source} from 'react-native-fast-image';
|
|
4
4
|
import styles from './styles';
|
|
5
|
-
import {
|
|
6
|
-
ApplicationContext,
|
|
7
|
-
ComponentContext,
|
|
8
|
-
MiniAppContext,
|
|
9
|
-
} from '../Application';
|
|
5
|
+
import {ApplicationContext} from '../Application';
|
|
10
6
|
import {Skeleton} from '../Skeleton';
|
|
11
7
|
import {Icon} from '../Icon';
|
|
12
8
|
import {Styles} from '../Consts';
|
|
@@ -23,8 +19,6 @@ const Image: React.FC<ImageProps> = ({
|
|
|
23
19
|
...rest
|
|
24
20
|
}) => {
|
|
25
21
|
const {theme} = useContext(ApplicationContext);
|
|
26
|
-
const app = useContext<any>(MiniAppContext);
|
|
27
|
-
const component = useContext<any>(ComponentContext);
|
|
28
22
|
const error = useRef(false);
|
|
29
23
|
const [status, setStatus] = useState<Status>('success');
|
|
30
24
|
|
|
@@ -32,13 +26,6 @@ const Image: React.FC<ImageProps> = ({
|
|
|
32
26
|
accessibilityLabel: accessibilityLabel || `img|${(source as Source).uri}`,
|
|
33
27
|
};
|
|
34
28
|
|
|
35
|
-
useEffect(() => {
|
|
36
|
-
if (app.enableAutoId) {
|
|
37
|
-
component?.addChildren?.(test.accessibilityLabel, 'add');
|
|
38
|
-
return () => component?.addChildren?.(test.accessibilityLabel, 'remove');
|
|
39
|
-
}
|
|
40
|
-
}, []);
|
|
41
|
-
|
|
42
29
|
/**
|
|
43
30
|
* render content loading | fail | rendered
|
|
44
31
|
*/
|
package/Loader/DotLoader.tsx
CHANGED
|
@@ -5,7 +5,7 @@ import {ApplicationContext} from '../Application';
|
|
|
5
5
|
import {hexToRGBA} from './utils';
|
|
6
6
|
import {LoaderProps} from './types';
|
|
7
7
|
|
|
8
|
-
const DotLoader: FC<LoaderProps> = ({color
|
|
8
|
+
const DotLoader: FC<LoaderProps> = ({color}) => {
|
|
9
9
|
const {theme} = useContext(ApplicationContext);
|
|
10
10
|
|
|
11
11
|
const arrayColor = [
|
|
@@ -28,7 +28,7 @@ const DotLoader: FC<LoaderProps> = ({color, style}) => {
|
|
|
28
28
|
return (
|
|
29
29
|
<AnimatedLottieView
|
|
30
30
|
source={source}
|
|
31
|
-
style={
|
|
31
|
+
style={{width: 52, height: 18}}
|
|
32
32
|
autoPlay
|
|
33
33
|
/>
|
|
34
34
|
);
|
package/Loader/Spinner.tsx
CHANGED
|
@@ -5,7 +5,7 @@ import {hexToRGBA} from './utils';
|
|
|
5
5
|
import {ApplicationContext} from '../Application';
|
|
6
6
|
import {LoaderProps} from './types';
|
|
7
7
|
|
|
8
|
-
const Spinner: FC<LoaderProps> = ({color
|
|
8
|
+
const Spinner: FC<LoaderProps> = ({color}) => {
|
|
9
9
|
const {theme} = useContext(ApplicationContext);
|
|
10
10
|
|
|
11
11
|
let source: any = animation;
|
|
@@ -20,7 +20,7 @@ const Spinner: FC<LoaderProps> = ({color, style}) => {
|
|
|
20
20
|
return (
|
|
21
21
|
<AnimatedLottieView
|
|
22
22
|
source={source}
|
|
23
|
-
style={
|
|
23
|
+
style={{width: 24, height: 24}}
|
|
24
24
|
autoPlay
|
|
25
25
|
/>
|
|
26
26
|
);
|