@momo-kits/foundation 0.92.3-tracking.8 → 0.92.4-beta.1

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.
@@ -117,9 +117,6 @@ const StackScreen: React.FC<ScreenParams> = props => {
117
117
  <ScreenContext.Provider
118
118
  value={{
119
119
  screenName,
120
- autoTracking: (data: any) => {
121
- navigator?.maxApi?.dispatchFunction?.('autoTracking', data);
122
- },
123
120
  onElementLoad: () => {
124
121
  endTime.current = Date.now();
125
122
  interaction.current?.cancel?.();
package/Image/index.tsx CHANGED
@@ -2,7 +2,7 @@ import React, {useContext, useEffect, 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 {ApplicationContext, ComponentContext} from '../Application';
5
+ import {ApplicationContext, ComponentContext, MiniAppContext} from '../Application';
6
6
  import {Skeleton} from '../Skeleton';
7
7
  import {Icon} from '../Icon';
8
8
  import {Styles} from '../Consts';
@@ -20,6 +20,7 @@ const Image: React.FC<ImageProps> = ({
20
20
  ...rest
21
21
  }) => {
22
22
  const {theme} = useContext(ApplicationContext);
23
+ const app = useContext<any>(MiniAppContext);
23
24
  const component = useContext<any>(ComponentContext);
24
25
  const error = useRef(false);
25
26
  const [status, setStatus] = useState<Status>('success');
@@ -29,8 +30,10 @@ const Image: React.FC<ImageProps> = ({
29
30
  };
30
31
 
31
32
  useEffect(() => {
32
- component?.addChildren?.(test.accessibilityLabel, 'add');
33
- return () => component?.addChildren(test.accessibilityLabel, 'remove');
33
+ if(app.enableAutoId){
34
+ component?.addChildren?.(test.accessibilityLabel, 'add');
35
+ return () => component?.addChildren(test.accessibilityLabel, 'remove');
36
+ }
34
37
  }, []);
35
38
 
36
39
  /**
@@ -54,45 +57,37 @@ const Image: React.FC<ImageProps> = ({
54
57
  };
55
58
 
56
59
  return (
57
- <ComponentContext.Provider
58
- value={{
59
- componentName: 'Image',
60
- params,
61
- state: loading ? 'loading' : 'loaded',
62
- componentId: test.accessibilityLabel,
63
- }}>
64
60
  <FastImage
65
- {...rest}
66
- {...test}
67
- source={source}
68
- style={[styles.container, style]}
69
- onProgress={() => {
70
- error.current = false;
71
- if (status !== 'loading' && loading) {
72
- setStatus('loading');
73
- }
74
- }}
75
- onLoadStart={() => {
76
- error.current = false;
77
- }}
78
- onLoad={() => {
79
- error.current = false;
80
- }}
81
- onLoadEnd={() => {
82
- let current: Status = 'success';
83
- if (error.current) {
84
- current = 'error';
85
- }
86
- if (status !== current) {
87
- setStatus(current);
88
- }
89
- }}
90
- onError={() => {
91
- error.current = true;
92
- }}>
61
+ {...rest}
62
+ {...test}
63
+ source={source}
64
+ style={[styles.container, style]}
65
+ onProgress={() => {
66
+ error.current = false;
67
+ if (status !== 'loading' && loading) {
68
+ setStatus('loading');
69
+ }
70
+ }}
71
+ onLoadStart={() => {
72
+ error.current = false;
73
+ }}
74
+ onLoad={() => {
75
+ error.current = false;
76
+ }}
77
+ onLoadEnd={() => {
78
+ let current: Status = 'success';
79
+ if (error.current) {
80
+ current = 'error';
81
+ }
82
+ if (status !== current) {
83
+ setStatus(current);
84
+ }
85
+ }}
86
+ onError={() => {
87
+ error.current = true;
88
+ }}>
93
89
  {renderContent()}
94
90
  </FastImage>
95
- </ComponentContext.Provider>
96
91
  );
97
92
  };
98
93
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/foundation",
3
- "version": "0.92.3-tracking.8",
3
+ "version": "0.92.4-beta.1",
4
4
  "description": "React Native Component Kits",
5
5
  "main": "index.ts",
6
6
  "scripts": {
@@ -10,18 +10,18 @@
10
10
  "@momo-kits/foundation"
11
11
  ],
12
12
  "dependencies": {
13
- "@gorhom/bottom-sheet": "git+https://gitlab.com/momo-platform/bottom-sheet.git#main",
13
+ "@gorhom/bottom-sheet": "2.4.1",
14
14
  "react-native-safe-area-context": "3.1.4",
15
15
  "react-native-linear-gradient": "2.8.3",
16
16
  "react-native-gesture-handler": "1.10.3",
17
17
  "react-native-modalize": "2.1.1",
18
18
  "react-native-fast-image": "8.1.5",
19
- "@react-navigation/bottom-tabs": "git+https://gitlab.com/momo-platform/react-navigation-bottom-tabs.git#main",
19
+ "@react-navigation/bottom-tabs": "git+https://gitlab.mservice.com.vn/momo-platform/react-navigation-bottom-tabs.git",
20
20
  "@react-navigation/core": "5.16.1",
21
21
  "@react-navigation/native": "5.9.8",
22
22
  "@react-navigation/routers": "5.7.4",
23
23
  "lottie-react-native": "3.3.2",
24
- "@react-navigation/stack": "git+https://gitlab.com/momo-platform/react-navigation-stack.git#main"
24
+ "@react-navigation/stack": "git+https://gitlab.mservice.com.vn/momo-platform/react-navigation-stack.git"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "react-native": "*"