@momo-kits/foundation 0.89.4-tracking.15 → 0.89.4-tracking.17

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.
@@ -4,7 +4,7 @@ import Navigation from './Navigation';
4
4
  import {ApplicationContext, MiniAppContext} from './index';
5
5
  import {GridSystem} from '../Layout';
6
6
  import {useHeaderHeight} from '@react-navigation/stack';
7
- import {InteractionManager} from 'react-native';
7
+ import {Alert, InteractionManager} from 'react-native';
8
8
 
9
9
  const {
10
10
  ScreenContext,
@@ -39,8 +39,9 @@ const StackScreen: React.FC<ScreenParams> = props => {
39
39
  }
40
40
  InteractionManager.runAfterInteractions(() => {
41
41
  navigator?.maxApi?.showToastDebug?.({
42
- title: 'screen_interaction_time',
43
- message: Date.now() - startTime.current,
42
+ title: `${Component.name} screen_interaction_time ${
43
+ Date.now() - startTime.current
44
+ }`,
44
45
  });
45
46
  });
46
47
  }, [options]);
@@ -49,6 +50,15 @@ const StackScreen: React.FC<ScreenParams> = props => {
49
50
  * tracking for screen
50
51
  */
51
52
  useEffect(() => {
53
+ if (__DEV__) {
54
+ if (!Component.name || Component.name === 'screen') {
55
+ Alert.alert(
56
+ 'Design system',
57
+ `Unvalidated screen name "${Component.name}" !`,
58
+ );
59
+ }
60
+ }
61
+
52
62
  const tracking = {
53
63
  ...context,
54
64
  screen_name: Component.name,
@@ -68,7 +78,7 @@ const StackScreen: React.FC<ScreenParams> = props => {
68
78
  };
69
79
  navigator?.maxApi?.trackEvent?.('service_frame_displayed', params);
70
80
  navigator?.maxApi?.showToastDebug?.({
71
- title: 'service_frame_displayed',
81
+ title: `${Component.name} service_frame_displayed`,
72
82
  params,
73
83
  });
74
84
 
@@ -80,7 +90,7 @@ const StackScreen: React.FC<ScreenParams> = props => {
80
90
  };
81
91
  navigator?.maxApi?.trackEvent?.('service_icon_clicked', params);
82
92
  navigator?.maxApi?.showToastDebug?.({
83
- title: 'service_icon_clicked',
93
+ title: `${Component.name} service_icon_clicked`,
84
94
  params,
85
95
  });
86
96
  });
@@ -101,8 +111,7 @@ const StackScreen: React.FC<ScreenParams> = props => {
101
111
  timeout.current = setTimeout(() => {
102
112
  timeLoad.current = endTime.current - startTime.current;
103
113
  navigator?.maxApi?.showToastDebug?.({
104
- title: 'screen_load_time',
105
- message: timeLoad.current,
114
+ title: `${Component.name} screen_load_time ${timeLoad.current}`,
106
115
  });
107
116
  }, 1000);
108
117
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/foundation",
3
- "version": "0.89.4-tracking.15",
3
+ "version": "0.89.4-tracking.17",
4
4
  "description": "React Native Component Kits",
5
5
  "main": "index.ts",
6
6
  "scripts": {