@momo-kits/template 0.103.2-rc.4 → 0.103.2-rc.41

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.
@@ -2,8 +2,7 @@ import React, {FC, useContext, useEffect, useState} from 'react';
2
2
  import {NativeModules, TouchableOpacity, View} from 'react-native';
3
3
  import {TrustBannerCallbackParams, TrustBannerProps} from './types';
4
4
  import styles from './styles';
5
- import {ApplicationContext, Colors, Image, Text} from '@momo-kits/foundation';
6
- import CustomAvatar from './CustomAvatar';
5
+ import {ApplicationContext, Icon, Image, Text} from '@momo-kits/foundation';
7
6
  import MaxApi from '@momo-platform/api';
8
7
 
9
8
  const defaultData = {
@@ -11,10 +10,13 @@ const defaultData = {
11
10
  vi: 'Bảo mật thông tin & An toàn tài sản của bạn là ưu tiên hàng đầu của MoMo.',
12
11
  en: "Your data security and money safety are MoMo's top priorities.",
13
12
  },
14
- pciImage: 'https://static.momocdn.net/app/img/kits/trustBanner/pci.png',
13
+ subContent: {
14
+ vi: 'Tìm hiểu thêm',
15
+ en: 'Learn more',
16
+ },
17
+ pciImage: 'https://static.momocdn.net/app/img/kits/trustBanner/pci_dss.png',
15
18
  sslImage: 'https://static.momocdn.net/app/img/kits/trustBanner/ssl.png',
16
- momoImage:
17
- 'https://static.momocdn.net/app/img/kits/trustBanner/ic_momo_secu.png',
19
+ momoImage: 'https://static.momocdn.net/app/img/kits/trustBanner/ic_secu.png',
18
20
  urlConfig: 'login_and_security',
19
21
  icons: [
20
22
  'https://static.momocdn.net/app/img/kits/trustBanner/ic_viettinbank.png',
@@ -31,9 +33,12 @@ const TrustBanner: FC<TrustBannerProps> = ({
31
33
  trackEvent,
32
34
  disabledPress = false,
33
35
  }) => {
34
- const {theme, language} = useContext(ApplicationContext);
36
+ const {theme, language = 'vi'} = useContext(ApplicationContext);
37
+ const currentLanguage: 'en' | 'vi' = language;
35
38
  const [data, setData] = useState(defaultData);
36
- const {icons, sslImage, pciImage, momoImage, urlConfig, content} = data;
39
+
40
+ const {sslImage, pciImage, momoImage, urlConfig, content, subContent} = data;
41
+
37
42
  const trackingParams: TrustBannerCallbackParams = {
38
43
  screen_name: screenName,
39
44
  service_name: serviceName,
@@ -48,7 +53,7 @@ const TrustBanner: FC<TrustBannerProps> = ({
48
53
  const fetchJson = () => {
49
54
  try {
50
55
  const config = JSON.parse(
51
- NativeModules?.ConfigsModule?.getConfigSync?.('DESIGN_SYSTEM'),
56
+ NativeModules?.ConfigsModule?.getConfigSync?.('DESIGN_SYSTEM')
52
57
  );
53
58
  const dataJSon = config?.trustBanner;
54
59
 
@@ -59,6 +64,7 @@ const TrustBanner: FC<TrustBannerProps> = ({
59
64
  pciImage: dataJSon.trustBanner.pciImage || defaultData.pciImage,
60
65
  momoImage: dataJSon.trustBanner.momoImage || defaultData.momoImage,
61
66
  content: dataJSon.trustBanner.content || defaultData.content,
67
+ subContent: dataJSon.trustBanner.subContent || defaultData.subContent,
62
68
  urlConfig: dataJSon.trustBanner.urlConfig || defaultData.urlConfig,
63
69
  });
64
70
  }
@@ -67,33 +73,19 @@ const TrustBanner: FC<TrustBannerProps> = ({
67
73
  }
68
74
  };
69
75
 
70
- const renderIconList = () => {
71
- return (
72
- <View style={styles.iconList}>
73
- {icons.map(icon => {
74
- return <CustomAvatar image={icon} />;
75
- })}
76
- <CustomAvatar
77
- style={[
78
- styles.customAvatar,
79
- {
80
- borderColor: theme.colors.border.default,
81
- backgroundColor: Colors.pink_09,
82
- },
83
- ]}
84
- text="36+"
85
- />
86
- </View>
87
- );
88
- };
89
-
90
76
  const renderFooter = () => {
91
77
  return (
92
- <View style={styles.footer}>
78
+ <View style={{flexDirection: 'row', justifyContent: 'space-between'}}>
79
+ <TouchableOpacity style={{flexDirection: 'row', alignItems: 'center'}}>
80
+ <Text typography={'action_xs_bold'} color={'#eb2f96'}>
81
+ {subContent?.[currentLanguage] || defaultData.subContent.vi}
82
+ </Text>
83
+ <Icon source={'arrow_chevron_right_small'} color={'#eb2f96'} />
84
+ </TouchableOpacity>
93
85
  <View style={styles.imageList}>
94
86
  <Image
95
87
  resizeMode={'contain'}
96
- style={[styles.image, styles.pciImage]}
88
+ style={styles.pciImage}
97
89
  source={{uri: pciImage}}
98
90
  />
99
91
  <Image
@@ -102,7 +94,6 @@ const TrustBanner: FC<TrustBannerProps> = ({
102
94
  source={{uri: sslImage}}
103
95
  />
104
96
  </View>
105
- {renderIconList()}
106
97
  </View>
107
98
  );
108
99
  };
@@ -115,7 +106,6 @@ const TrustBanner: FC<TrustBannerProps> = ({
115
106
  MaxApi.startFeatureCode(urlConfig, {}, () => {});
116
107
  }
117
108
  };
118
-
119
109
  return (
120
110
  <TouchableOpacity
121
111
  disabled={disabledPress}
@@ -134,7 +124,7 @@ const TrustBanner: FC<TrustBannerProps> = ({
134
124
  style={styles.message}
135
125
  color={theme.colors.text.secondary}
136
126
  typography={'description_default_regular'}>
137
- {content?.[language || 'vi'] || defaultData.content.vi}
127
+ {content?.[currentLanguage] || defaultData.content.vi}
138
128
  </Text>
139
129
  {renderFooter()}
140
130
  </View>
@@ -24,6 +24,8 @@ export default StyleSheet.create({
24
24
  },
25
25
  pciImage: {
26
26
  marginRight: Spacing.XS,
27
+ width: 25,
28
+ height: 20,
27
29
  },
28
30
  message: {marginBottom: Spacing.S},
29
31
  footer: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/template",
3
- "version": "0.103.2-rc.4",
3
+ "version": "0.103.2-rc.41",
4
4
  "private": false,
5
5
  "main": "index.tsx",
6
6
  "dependencies": {},