@momo-kits/foundation 0.103.1-optimize.4 → 0.103.1-optimize.5
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/Application/Localize.ts +5 -1
- package/Tag/index.tsx +9 -2
- package/Tag/types.ts +12 -0
- package/index.ts +0 -7
- package/package.json +1 -3
package/Application/Localize.ts
CHANGED
|
@@ -4,7 +4,7 @@ import defaultLanguage from '../Assets/language.json';
|
|
|
4
4
|
|
|
5
5
|
class Localize {
|
|
6
6
|
private assets: LocalizationObject;
|
|
7
|
-
private
|
|
7
|
+
private currentLanguage: 'en' | 'vi';
|
|
8
8
|
|
|
9
9
|
constructor(assets: LocalizationObject) {
|
|
10
10
|
this.assets = {
|
|
@@ -21,6 +21,10 @@ class Localize {
|
|
|
21
21
|
return this.currentLanguage;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
get getAssets() {
|
|
25
|
+
return this.assets;
|
|
26
|
+
}
|
|
27
|
+
|
|
24
28
|
translate(key: string) {
|
|
25
29
|
return this.assets[this.currentLanguage]?.[key] || key;
|
|
26
30
|
}
|
package/Tag/index.tsx
CHANGED
|
@@ -31,6 +31,8 @@ const Tag: FC<TagProps> = ({
|
|
|
31
31
|
size = 'large',
|
|
32
32
|
style,
|
|
33
33
|
customColor,
|
|
34
|
+
accessibilityLabelContainer,
|
|
35
|
+
accessibilityLabelText,
|
|
34
36
|
}) => {
|
|
35
37
|
let labelColor = textColor[color];
|
|
36
38
|
let tagColor = backgroundColor[color];
|
|
@@ -60,7 +62,9 @@ const Tag: FC<TagProps> = ({
|
|
|
60
62
|
}
|
|
61
63
|
|
|
62
64
|
return (
|
|
63
|
-
<View
|
|
65
|
+
<View
|
|
66
|
+
style={[style, sizeStyle, {backgroundColor: tagColor}]}
|
|
67
|
+
accessibilityLabel={accessibilityLabelContainer}>
|
|
64
68
|
{!!icon && (
|
|
65
69
|
<Icon
|
|
66
70
|
style={styles.icon}
|
|
@@ -69,7 +73,10 @@ const Tag: FC<TagProps> = ({
|
|
|
69
73
|
color={labelColor}
|
|
70
74
|
/>
|
|
71
75
|
)}
|
|
72
|
-
<Text
|
|
76
|
+
<Text
|
|
77
|
+
color={labelColor}
|
|
78
|
+
typography={'label_s_medium'}
|
|
79
|
+
accessibilityLabel={accessibilityLabelText}>
|
|
73
80
|
{label}
|
|
74
81
|
</Text>
|
|
75
82
|
</View>
|
package/Tag/types.ts
CHANGED
|
@@ -33,4 +33,16 @@ export type TagProps = {
|
|
|
33
33
|
* that can be applied to the Tag component.
|
|
34
34
|
*/
|
|
35
35
|
customColor?: string;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Overrides the text that's read by the screen reader when the user interacts with the element. By default, the
|
|
39
|
+
* label is constructed by traversing all the children and accumulating all the Text nodes separated by space.
|
|
40
|
+
*/
|
|
41
|
+
accessibilityLabelContainer?: string;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Overrides the text that's read by the screen reader when the user interacts with the element. By default, the
|
|
45
|
+
* label is constructed by traversing all the children and accumulating all the Text nodes separated by space.
|
|
46
|
+
*/
|
|
47
|
+
accessibilityLabelText?: string;
|
|
36
48
|
};
|
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.
|
|
3
|
+
"version": "0.103.1-optimize.5",
|
|
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",
|