@momo-kits/foundation 0.103.1-optimize.7 → 0.103.1-optimize.9

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/Text/index.tsx CHANGED
@@ -3,7 +3,7 @@ import {Text as RNText, TextProps as RNTextProps} from 'react-native';
3
3
  import styles from './styles';
4
4
  import {Typography, TypographyWeight} from './types';
5
5
  import {ApplicationContext} from '../Application';
6
- import {scaleSize} from './utils';
6
+ import {getAccessibilityID, scaleSize} from './utils';
7
7
 
8
8
  const SFProText: TypographyWeight = {
9
9
  100: 'Thin',
@@ -109,6 +109,7 @@ const Text: React.FC<TextProps> = ({
109
109
  };
110
110
  };
111
111
 
112
+
112
113
  const textStyle = getTypoStyle(typography);
113
114
 
114
115
  if (deprecatedValues.includes(typography)) {
@@ -120,6 +121,7 @@ const Text: React.FC<TextProps> = ({
120
121
  return (
121
122
  <RNText
122
123
  {...rest}
124
+ {...getAccessibilityID((rest.accessibilityLabel))}
123
125
  style={[style, textStyle, {color: color ?? theme.colors.text.default}]}>
124
126
  {children ?? ''}
125
127
  </RNText>
package/Text/utils.ts CHANGED
@@ -1,4 +1,4 @@
1
- import {Dimensions} from 'react-native';
1
+ import {Dimensions, Platform} from 'react-native';
2
2
 
3
3
  const deviceWidth = Dimensions.get('window').width;
4
4
  const DEFAULT_SCREEN_SIZE = 375;
@@ -11,4 +11,16 @@ const scaleSize = (size: number) => {
11
11
 
12
12
  return size;
13
13
  };
14
- export {scaleSize};
14
+ const getAccessibilityID = (accessibilityLabel = '') => {
15
+ if (Platform.OS ==='ios') {
16
+ return {
17
+ accessible: true,
18
+ testID: accessibilityLabel,
19
+ };
20
+ } else {
21
+ return {
22
+ accessibilityLabel,
23
+ };
24
+ }
25
+ };
26
+ export {scaleSize,getAccessibilityID};
package/index.ts CHANGED
@@ -49,10 +49,3 @@ export * from './Title';
49
49
  export * from './Title/types';
50
50
  export * from './Badge';
51
51
  export * from './Badge/types';
52
-
53
- /**
54
- * export trick for keep old mini app working
55
- * @deprecated
56
- */
57
- export * from 'react-native-modalize';
58
- export * from '@gorhom/bottom-sheet';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/foundation",
3
- "version": "0.103.1-optimize.7",
3
+ "version": "0.103.1-optimize.9",
4
4
  "description": "React Native Component Kits",
5
5
  "main": "index.ts",
6
6
  "scripts": {},
@@ -8,11 +8,9 @@
8
8
  "@momo-kits/foundation"
9
9
  ],
10
10
  "dependencies": {
11
- "@gorhom/bottom-sheet": "2.4.1",
12
11
  "react-native-safe-area-context": "3.1.4",
13
12
  "react-native-linear-gradient": "2.8.3",
14
13
  "react-native-gesture-handler": "1.10.3",
15
- "react-native-modalize": "2.1.1",
16
14
  "react-native-fast-image": "8.1.5",
17
15
  "@react-navigation/bottom-tabs": "https://gitlab.mservice.com.vn/momo-platform/react-native-bottom-tabs.git",
18
16
  "@react-navigation/core": "5.16.1",
package/publish.sh CHANGED
@@ -9,8 +9,8 @@ elif [ "$1" == "latest" ]; then
9
9
  npm version prerelease --preid=rc
10
10
  npm publish --tag latest --access=public
11
11
  else
12
- # npm version $(npm view @momo-kits/foundation@beta version)
13
- # npm version prerelease --preid=beta
12
+ npm version $(npm view @momo-kits/foundation@beta version)
13
+ npm version prerelease --preid=beta
14
14
  npm publish --tag beta --access=public
15
15
  fi
16
16