@momo-kits/foundation 0.92.29-optimize.12 → 0.92.29-optimize.15

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.
@@ -95,6 +95,8 @@ const StackScreen: React.FC<ScreenParams> = props => {
95
95
  const timeInteraction = useRef(0);
96
96
  const timeoutLoad = useRef<any>();
97
97
  const tracked = useRef<any>({
98
+ traceIdLoad: undefined,
99
+ traceIdInteraction: undefined,
98
100
  releaseLoad: undefined,
99
101
  releaseInteraction: undefined,
100
102
  timeoutLoad: undefined,
@@ -125,6 +127,15 @@ const StackScreen: React.FC<ScreenParams> = props => {
125
127
  if (options) {
126
128
  navigation.setOptions(options);
127
129
  }
130
+ navigator?.maxApi?.startTraceScreenLoad?.(screenName, (data: any) => {
131
+ tracked.current.traceIdLoad = data?.traceId;
132
+ });
133
+ navigator?.maxApi?.startTraceScreenInteraction?.(
134
+ screenName,
135
+ (data: any) => {
136
+ tracked.current.traceIdInteraction = data?.traceId;
137
+ }
138
+ );
128
139
  }, [options]);
129
140
 
130
141
  /**
@@ -170,6 +181,11 @@ const StackScreen: React.FC<ScreenParams> = props => {
170
181
  state: 'load',
171
182
  duration: timeLoad.current,
172
183
  });
184
+ navigator?.maxApi?.stopTrace?.(
185
+ tracked.current.traceIdLoad,
186
+ {value: timeLoad.current},
187
+ null
188
+ );
173
189
  navigator?.maxApi?.showToastDebug?.({
174
190
  appId: `auto - ${context.appId}`,
175
191
  message: `${screenName} screen_load_time ${timeLoad.current}`,
@@ -189,6 +205,13 @@ const StackScreen: React.FC<ScreenParams> = props => {
189
205
  if (timeLoad.current === 0) {
190
206
  timeLoad.current = endTime.current - startTime.current;
191
207
  }
208
+ if (timeInteraction.current === 0 && context.enableAutoId) {
209
+ if (context.enableAutoId) {
210
+ Alert.alert(screenName, "Can't get screen interaction time");
211
+ }
212
+ timeInteraction.current = timeLoad.current;
213
+ }
214
+
192
215
  context.autoTracking?.({
193
216
  appId: context.appId,
194
217
  code: context.code,
@@ -198,17 +221,15 @@ const StackScreen: React.FC<ScreenParams> = props => {
198
221
  state: 'interaction',
199
222
  duration: timeInteraction.current - timeLoad.current,
200
223
  });
201
-
224
+ navigator?.maxApi?.stopTrace?.(
225
+ tracked.current.traceIdInteraction,
226
+ {value: timeInteraction.current},
227
+ null
228
+ );
202
229
  navigator?.maxApi?.showToastDebug?.({
203
230
  appId: `auto - ${context.appId}`,
204
231
  message: `${screenName} screen_interaction_time ${timeInteraction.current}`,
205
232
  });
206
- if (
207
- timeInteraction.current - timeLoad.current <= 0 &&
208
- context.enableAutoId
209
- ) {
210
- Alert.alert(screenName, "Can't get screen interaction time");
211
- }
212
233
  tracked.current.releaseInteraction = true;
213
234
  }
214
235
  };
package/Input/styles.ts CHANGED
@@ -140,13 +140,13 @@ export default StyleSheet.create({
140
140
  marginTop: Spacing.M,
141
141
  },
142
142
  otpInput: {
143
- height: scaleSize(56),
143
+ height: 56,
144
144
  borderRadius: Radius.S,
145
145
  borderWidth: 1,
146
146
  },
147
147
  otpFloatingView: {
148
148
  position: 'absolute',
149
- top: scaleSize(-Spacing.M + 2),
149
+ top: -Spacing.M + 2,
150
150
  alignSelf: 'center',
151
151
  paddingHorizontal: Spacing.S,
152
152
  },
@@ -1,5 +1,5 @@
1
1
  import React, {FC, useContext, useRef, useState} from 'react';
2
- import {Animated, View} from 'react-native';
2
+ import {Animated, Dimensions, View} from 'react-native';
3
3
  import {ScrollIndicatorProps} from './types';
4
4
  import styles from './styles';
5
5
  import {ApplicationContext} from '../Application';
@@ -42,7 +42,7 @@ const PaginationScroll: FC<ScrollIndicatorProps> = ({
42
42
  },
43
43
  },
44
44
  ],
45
- {useNativeDriver: true},
45
+ {useNativeDriver: true}
46
46
  )}
47
47
  alwaysBounceHorizontal={false}
48
48
  showsHorizontalScrollIndicator={false}
@@ -80,7 +80,7 @@ const PaginationScroll: FC<ScrollIndicatorProps> = ({
80
80
  return (
81
81
  <View style={[style, styles.scrollContainer]}>
82
82
  {renderScrollView()}
83
- {renderIndicator()}
83
+ {scrollContentWidth > scrollViewWidth && renderIndicator()}
84
84
  </View>
85
85
  );
86
86
  };
@@ -29,7 +29,6 @@ export default StyleSheet.create({
29
29
  justifyContent: 'center',
30
30
  },
31
31
  scrollContainer: {
32
- alignItems: 'center',
33
32
  width: '100%',
34
33
  },
35
34
  scrollView: {
@@ -42,6 +41,7 @@ export default StyleSheet.create({
42
41
  borderRadius: Radius.XS,
43
42
  },
44
43
  indicatorContainer: {
44
+ alignSelf: 'center',
45
45
  width: 72,
46
46
  height: 4,
47
47
  borderRadius: Radius.XS,
@@ -195,7 +195,7 @@ const PopupNotify: React.FC<PopupNotifyProps> = ({
195
195
  ]}>
196
196
  {!!image && <Image source={{uri: image}} style={styles.image} />}
197
197
  <View style={styles.content}>
198
- <Text typography={'header_default_bold'} numberOfLines={1}>
198
+ <Text typography={'header_default_bold'} numberOfLines={3}>
199
199
  {title}
200
200
  </Text>
201
201
  <Description style={[styles.description, descriptionStyle]}>
package/Tag/styles.ts CHANGED
@@ -1,19 +1,20 @@
1
1
  import {StyleSheet} from 'react-native';
2
2
  import {Radius, Spacing} from '../Consts';
3
+ import {scaleSize} from '../Text';
3
4
 
4
5
  export default StyleSheet.create({
5
6
  container: {
6
7
  paddingHorizontal: Spacing.S,
7
8
  borderRadius: Radius.S,
8
9
  flexDirection: 'row',
9
- height: 24,
10
+ height: scaleSize(24),
10
11
  alignItems: 'center',
11
12
  justifyContent: 'center',
12
13
  },
13
14
  mediumContainer: {
14
15
  paddingHorizontal: Spacing.S,
15
16
  borderRadius: Radius.S,
16
- height: 18,
17
+ height: scaleSize(18),
17
18
  alignItems: 'center',
18
19
  flexDirection: 'row',
19
20
  justifyContent: 'center',
package/package.json CHANGED
@@ -1,46 +1,46 @@
1
1
  {
2
- "name": "@momo-kits/foundation",
3
- "version": "0.92.29-optimize.12",
4
- "description": "React Native Component Kits",
5
- "main": "index.ts",
6
- "scripts": {},
7
- "keywords": [
8
- "@momo-kits/foundation"
9
- ],
10
- "dependencies": {
11
- "@gorhom/bottom-sheet": "2.4.1",
12
- "react-native-safe-area-context": "3.1.4",
13
- "react-native-linear-gradient": "2.8.3",
14
- "react-native-gesture-handler": "1.10.3",
15
- "react-native-modalize": "2.1.1",
16
- "react-native-fast-image": "8.1.5",
17
- "@react-navigation/bottom-tabs": "https://oauth2:5WXQLHPMxxCyvGt_Py4D@gitlab.mservice.com.vn/momo-platform/react-native-bottom-tabs.git",
18
- "@react-navigation/core": "5.16.1",
19
- "@react-navigation/native": "5.9.8",
20
- "@react-navigation/routers": "5.7.4",
21
- "lottie-react-native": "git+https://gitlab.mservice.com.vn/momo-platform/momo-lottie-react-native.git",
22
- "@react-navigation/stack": "https://oauth2:eX-jVhzQdLc343AjD3Sc@gitlab.mservice.com.vn/momo-platform/react-navigation-stack.git"
23
- },
24
- "peerDependencies": {
25
- "react-native": "*"
26
- },
27
- "devDependencies": {
28
- "@babel/core": "^7.12.9",
29
- "@babel/runtime": "^7.12.5",
30
- "@react-native-community/eslint-config": "^2.0.0",
31
- "@types/jest": "26.0.23",
32
- "@types/react-native": "0.64.4",
33
- "@types/react-test-renderer": "16.9.2",
34
- "@types/d3-shape": "1.3.7",
35
- "babel-jest": "^26.6.3",
36
- "eslint": "^7.14.0",
37
- "jest": "^26.6.3",
38
- "metro-react-native-babel-preset": "^0.64.0",
39
- "react-test-renderer": "17.0.1",
40
- "typescript": "^4.0.3",
41
- "@momo-platform/versions": "4.1.11",
42
- "react-scanner": "^1.1.0"
43
- },
44
- "author": "@momo-kits/foundation",
45
- "license": "ISC"
2
+ "name": "@momo-kits/foundation",
3
+ "version": "0.92.29-optimize.15",
4
+ "description": "React Native Component Kits",
5
+ "main": "index.ts",
6
+ "scripts": {},
7
+ "keywords": [
8
+ "@momo-kits/foundation"
9
+ ],
10
+ "dependencies": {
11
+ "@gorhom/bottom-sheet": "2.4.1",
12
+ "react-native-safe-area-context": "3.1.4",
13
+ "react-native-linear-gradient": "2.8.3",
14
+ "react-native-gesture-handler": "1.10.3",
15
+ "react-native-modalize": "2.1.1",
16
+ "react-native-fast-image": "8.1.5",
17
+ "@react-navigation/bottom-tabs": "https://oauth2:5WXQLHPMxxCyvGt_Py4D@gitlab.mservice.com.vn/momo-platform/react-native-bottom-tabs.git",
18
+ "@react-navigation/core": "5.16.1",
19
+ "@react-navigation/native": "5.9.8",
20
+ "@react-navigation/routers": "5.7.4",
21
+ "lottie-react-native": "git+https://gitlab.mservice.com.vn/momo-platform/momo-lottie-react-native.git",
22
+ "@react-navigation/stack": "https://oauth2:eX-jVhzQdLc343AjD3Sc@gitlab.mservice.com.vn/momo-platform/react-navigation-stack.git"
23
+ },
24
+ "peerDependencies": {
25
+ "react-native": "*"
26
+ },
27
+ "devDependencies": {
28
+ "@babel/core": "^7.12.9",
29
+ "@babel/runtime": "^7.12.5",
30
+ "@react-native-community/eslint-config": "^2.0.0",
31
+ "@types/jest": "26.0.23",
32
+ "@types/react-native": "0.64.4",
33
+ "@types/react-test-renderer": "16.9.2",
34
+ "@types/d3-shape": "1.3.7",
35
+ "babel-jest": "^26.6.3",
36
+ "eslint": "^7.14.0",
37
+ "jest": "^26.6.3",
38
+ "metro-react-native-babel-preset": "^0.64.0",
39
+ "react-test-renderer": "17.0.1",
40
+ "typescript": "^4.0.3",
41
+ "@momo-platform/versions": "4.1.11",
42
+ "react-scanner": "^1.1.0"
43
+ },
44
+ "author": "@momo-kits/foundation",
45
+ "license": "ISC"
46
46
  }
package/publish.sh CHANGED
@@ -1,28 +1,18 @@
1
1
  #!/bin/bash
2
2
 
3
- # Prepare dist files
4
- rm -rf dist
5
- mkdir dist
6
- rsync -r --exclude=/dist ./* dist
7
- cd dist
8
-
9
3
  if [ "$1" == "stable" ]; then
10
- #npm version $(npm view @momo-kits/foundation@stable version)
11
- #npm version patch
4
+ npm version $(npm view @momo-kits/foundation@stable version)
5
+ npm version patch
12
6
  npm publish --tag stable --access=public
13
7
  elif [ "$1" == "latest" ]; then
14
- #npm version $(npm view @momo-kits/foundation@latest version)
15
- #npm version prerelease --preid=rc
8
+ npm version $(npm view @momo-kits/foundation@latest version)
9
+ npm version prerelease --preid=rc
16
10
  npm publish --tag latest --access=public
17
11
  else
18
- #npm version $(npm view @momo-kits/foundation@beta version)
19
- #npm version prerelease --preid=beta
12
+ # npm version $(npm view @momo-kits/foundation@beta version)
13
+ # npm version prerelease --preid=beta
20
14
  npm publish --tag beta --access=public
21
15
  fi
22
16
 
23
17
  PACKAGE_NAME=$(npm pkg get name)
24
18
  NEW_PACKAGE_VERSION=$(npm pkg get version)
25
-
26
- # Clean up
27
- cd ..
28
- rm -rf dist