@momo-kits/template 0.81.7 → 0.81.8

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.
@@ -56,7 +56,6 @@ const HeaderSliderBanner: FC<HeaderSliderBannerProps> = ({
56
56
  height: 210,
57
57
  opacity: opacity,
58
58
  transform: [{scale}, {translateY}],
59
- backgroundColor: 'red',
60
59
  }}>
61
60
  <Carousel
62
61
  {...carouselProps}
@@ -0,0 +1,37 @@
1
+ import React, {FC, useContext} from 'react';
2
+ import {View} from 'react-native';
3
+ import styles from './styles';
4
+ import {ApplicationContext, Colors, Image, Text} from '@momo-kits/foundation';
5
+ import {CustomAvatarProps} from './types';
6
+
7
+ const CustomAvatar: FC<CustomAvatarProps> = ({image, text, style}) => {
8
+ const {theme} = useContext(ApplicationContext);
9
+
10
+ const renderContent = () => {
11
+ if (text) {
12
+ return (
13
+ <Text color={theme.colors.primary} typography={'description_xs'}>
14
+ {text}
15
+ </Text>
16
+ );
17
+ }
18
+
19
+ return <Image style={styles.avatarImage} source={{uri: image}} />;
20
+ };
21
+
22
+ return (
23
+ <View
24
+ style={[
25
+ styles.customAvatar,
26
+ {
27
+ backgroundColor: Colors.black_01,
28
+ borderColor: theme.colors.border.default,
29
+ },
30
+ style,
31
+ ]}>
32
+ {renderContent()}
33
+ </View>
34
+ );
35
+ };
36
+
37
+ export default CustomAvatar;
@@ -0,0 +1,87 @@
1
+ import React, {FC, useContext} from 'react';
2
+ import {requireNativeComponent, UIManager, View, ViewProps} from 'react-native';
3
+ import {TrustBannerProps} from './types';
4
+ import styles from './styles';
5
+ import {ApplicationContext, Colors, Image, Text} from '@momo-kits/foundation';
6
+ import CustomAvatar from './CustomAvatar';
7
+ const NativeTrustBanner = requireNativeComponent<ViewProps>('TrustBannerView');
8
+
9
+ const defaultIcons = [
10
+ 'https://static.momocdn.net/app/img/kits/trustBanner/ic_viettinbank.png',
11
+ 'https://static.momocdn.net/app/img/kits/trustBanner/ic_agribank.png',
12
+ 'https://static.momocdn.net/app/img/kits/trustBanner/ic_vietcombank.png',
13
+ 'https://static.momocdn.net/app/img/kits/trustBanner/ic_bidv.png',
14
+ ];
15
+ const TrustBanner: FC<TrustBannerProps> = ({
16
+ message = '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.',
17
+ pciImage = 'https://static.momocdn.net/app/img/kits/trustBanner/pci.png',
18
+ sslImage = 'https://static.momocdn.net/app/img/kits/trustBanner/ssl.png',
19
+ icons = defaultIcons,
20
+ style,
21
+ }) => {
22
+ const {theme} = useContext(ApplicationContext);
23
+
24
+ const renderIconList = () => {
25
+ return (
26
+ <View style={styles.iconList}>
27
+ {icons.map(icon => {
28
+ return <CustomAvatar image={icon} />;
29
+ })}
30
+ <CustomAvatar
31
+ style={[
32
+ styles.customAvatar,
33
+ {
34
+ borderColor: theme.colors.border.default,
35
+ backgroundColor: Colors.pink_09,
36
+ },
37
+ ]}
38
+ text="+36"
39
+ />
40
+ </View>
41
+ );
42
+ };
43
+
44
+ const renderFooter = () => {
45
+ return (
46
+ <View style={styles.footer}>
47
+ <View style={styles.imageList}>
48
+ <Image
49
+ resizeMode={'contain'}
50
+ style={[styles.image, styles.pciImage]}
51
+ source={{uri: pciImage}}
52
+ />
53
+ <Image
54
+ resizeMode={'contain'}
55
+ style={styles.image}
56
+ source={{uri: sslImage}}
57
+ />
58
+ </View>
59
+ {renderIconList()}
60
+ </View>
61
+ );
62
+ };
63
+
64
+ if (UIManager.getViewManagerConfig('TrustBannerView')) {
65
+ return <NativeTrustBanner style={{height: 88}} />;
66
+ }
67
+
68
+ return (
69
+ <View style={[style, styles.container]}>
70
+ <Image
71
+ style={styles.momoImage}
72
+ resizeMode={'contain'}
73
+ source={{
74
+ uri: 'https://static.momocdn.net/app/img/kits/trustBanner/ic_momo_secu.png',
75
+ }}
76
+ />
77
+ <View style={styles.flex}>
78
+ <Text style={styles.message} typography={'description_s'}>
79
+ {message}
80
+ </Text>
81
+ {renderFooter()}
82
+ </View>
83
+ </View>
84
+ );
85
+ };
86
+
87
+ export default TrustBanner;
@@ -0,0 +1,46 @@
1
+ import {StyleSheet} from 'react-native';
2
+ import {Colors, Radius, scaleSize, Spacing} from '@momo-kits/foundation';
3
+
4
+ export default StyleSheet.create({
5
+ container: {
6
+ flexDirection: 'row',
7
+ padding: Spacing.M,
8
+ borderRadius: Radius.S,
9
+ backgroundColor: Colors.blue_10,
10
+ width: '100%',
11
+ },
12
+ flex: {flex: 1},
13
+ momoImage: {
14
+ width: scaleSize(64),
15
+ height: scaleSize(64),
16
+ marginRight: Spacing.S,
17
+ },
18
+ image: {
19
+ width: scaleSize(52),
20
+ height: scaleSize(20),
21
+ },
22
+ imageList: {
23
+ flexDirection: 'row',
24
+ },
25
+ pciImage: {
26
+ marginRight: Spacing.XS,
27
+ },
28
+ message: {marginBottom: Spacing.S},
29
+ footer: {
30
+ flexDirection: 'row',
31
+ justifyContent: 'space-between',
32
+ },
33
+ customAvatar: {
34
+ width: scaleSize(24),
35
+ height: scaleSize(24),
36
+ borderWidth: 1,
37
+ borderRadius: Radius.L,
38
+ alignItems: 'center',
39
+ justifyContent: 'center',
40
+ marginLeft: scaleSize(-6),
41
+ },
42
+ iconList: {
43
+ flexDirection: 'row',
44
+ },
45
+ avatarImage: {width: '100%', height: '100%'},
46
+ });
@@ -0,0 +1,15 @@
1
+ import {ViewStyle} from 'react-native';
2
+
3
+ export type TrustBannerProps = {
4
+ message?: string;
5
+ icons?: string[];
6
+ pciImage?: string;
7
+ sslImage?: string;
8
+ style?: ViewStyle | ViewStyle[];
9
+ };
10
+
11
+ export type CustomAvatarProps = {
12
+ image?: string;
13
+ text?: string;
14
+ style?: ViewStyle[] | ViewStyle;
15
+ };
package/index.tsx CHANGED
@@ -1,3 +1,3 @@
1
1
  import HeaderSliderBanner from './HeaderSliderBanner';
2
-
3
- export {HeaderSliderBanner};
2
+ import TrustBanner from './TrustBanner';
3
+ export {HeaderSliderBanner, TrustBanner};
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@momo-kits/template",
3
- "version": "0.81.7",
3
+ "version": "0.81.8",
4
4
  "private": false,
5
5
  "main": "index.tsx",
6
6
  "dependencies": {},
7
7
  "peerDependencies": {
8
8
  "@momo-kits/foundation": "latest",
9
- "@momo-kits/carousel": "0.80.8-beta.12",
9
+ "@momo-kits/carousel": "0.81.6-beta.12",
10
10
  "prop-types": "^15.7.2",
11
11
  "react": "16.9.0",
12
12
  "react-native": ">=0.55"