@momo-kits/template 0.113.1-beta.1 → 0.113.1-beta.3
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/TrustBanner/index.tsx +16 -7
- package/package.json +1 -1
package/TrustBanner/index.tsx
CHANGED
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
Icon,
|
|
8
8
|
Image,
|
|
9
9
|
MiniAppContext,
|
|
10
|
+
Styles,
|
|
10
11
|
Text,
|
|
11
12
|
} from '@momo-kits/foundation';
|
|
12
13
|
// @ts-ignore
|
|
@@ -44,8 +45,12 @@ const TrustBanner: FC<TrustBannerProps> = ({
|
|
|
44
45
|
trackEvent,
|
|
45
46
|
}) => {
|
|
46
47
|
const context = useContext<any>(MiniAppContext);
|
|
47
|
-
const {
|
|
48
|
-
|
|
48
|
+
const {
|
|
49
|
+
theme,
|
|
50
|
+
translate = (data: {vi: string; en: string}) => {
|
|
51
|
+
return data.vi;
|
|
52
|
+
},
|
|
53
|
+
} = useContext(ApplicationContext);
|
|
49
54
|
|
|
50
55
|
const {
|
|
51
56
|
sslImage,
|
|
@@ -72,7 +77,7 @@ const TrustBanner: FC<TrustBannerProps> = ({
|
|
|
72
77
|
if (urlConfig.indexOf('https') > -1) {
|
|
73
78
|
const openWebData = {
|
|
74
79
|
url: urlConfig,
|
|
75
|
-
title: titleWeb
|
|
80
|
+
title: translate(titleWeb) || subContent.vi,
|
|
76
81
|
};
|
|
77
82
|
MaxApi.openWeb(openWebData);
|
|
78
83
|
} else {
|
|
@@ -83,11 +88,15 @@ const TrustBanner: FC<TrustBannerProps> = ({
|
|
|
83
88
|
const renderFooter = () => {
|
|
84
89
|
return (
|
|
85
90
|
<View style={{flexDirection: 'row', justifyContent: 'space-between'}}>
|
|
86
|
-
<View style={
|
|
91
|
+
<View style={Styles.row}>
|
|
87
92
|
<Text typography={'action_xs_bold'} color={'#eb2f96'}>
|
|
88
|
-
{subContent
|
|
93
|
+
{translate(subContent) || subContent.vi}
|
|
89
94
|
</Text>
|
|
90
|
-
<Icon
|
|
95
|
+
<Icon
|
|
96
|
+
source={'arrow_chevron_right_small'}
|
|
97
|
+
color={'#eb2f96'}
|
|
98
|
+
size={20}
|
|
99
|
+
/>
|
|
91
100
|
</View>
|
|
92
101
|
<View style={styles.imageList}>
|
|
93
102
|
<Image
|
|
@@ -123,7 +132,7 @@ const TrustBanner: FC<TrustBannerProps> = ({
|
|
|
123
132
|
color={theme.colors.text.secondary}
|
|
124
133
|
typography={'description_default_regular'}
|
|
125
134
|
numberOfLines={2}>
|
|
126
|
-
{content
|
|
135
|
+
{translate(content) || content.vi}
|
|
127
136
|
</Text>
|
|
128
137
|
{renderFooter()}
|
|
129
138
|
</View>
|