@momo-kits/template 0.102.3-beta.0 → 0.102.3-beta.1

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,29 +73,15 @@ 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'}
@@ -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>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/template",
3
- "version": "0.102.3-beta.0",
3
+ "version": "0.102.3-beta.1",
4
4
  "private": false,
5
5
  "main": "index.tsx",
6
6
  "dependencies": {},
@@ -13,4 +13,4 @@
13
13
  "@momo-platform/api": "0.1.67-rc.3"
14
14
  },
15
15
  "license": "MoMo"
16
- }
16
+ }
package/publish.sh CHANGED
@@ -7,15 +7,15 @@ rsync -r --exclude=/dist ./* dist
7
7
  cd dist
8
8
 
9
9
  if [ "$1" == "stable" ]; then
10
- #npm version $(npm view @momo-kits/template@stable version)
11
- #npm version patch
10
+ npm version $(npm view @momo-kits/foundation@stable version)
11
+ npm version patch
12
12
  npm publish --tag stable --access=public
13
13
  elif [ "$1" == "latest" ]; then
14
- #npm version $(npm view @momo-kits/foundation@latest version)
14
+ npm version $(npm view @momo-kits/foundation@latest version)
15
15
  npm publish --tag latest --access=public
16
16
  else
17
- #npm version $(npm view @momo-kits/template@beta version)
18
- #npm version prerelease --preid=beta
17
+ npm version $(npm view @momo-kits/template@beta version)
18
+ npm version prerelease --preid=beta
19
19
  npm publish --tag beta --access=public
20
20
  fi
21
21