@momo-kits/badge 0.81.18 → 0.81.19

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/BadgeRibbon.tsx CHANGED
@@ -1,9 +1,15 @@
1
1
  import React, {FC, useContext} from 'react';
2
2
  import {View} from 'react-native';
3
- import {DownTail, Skew, UpTail} from './Shape';
3
+ import {DownTail, UpTail} from './Shape';
4
4
  import styles from './styles';
5
5
  import {BadgeRibbonProps} from './types';
6
- import {ApplicationContext, Colors, Text} from '@momo-kits/foundation';
6
+ import {
7
+ ApplicationContext,
8
+ Colors,
9
+ Image,
10
+ Spacing,
11
+ Text,
12
+ } from '@momo-kits/foundation';
7
13
 
8
14
  const BadgeRibbon: FC<BadgeRibbonProps> = ({
9
15
  position = 'top_right',
@@ -81,6 +87,7 @@ const BadgeRibbon: FC<BadgeRibbonProps> = ({
81
87
  rotate: textRotate,
82
88
  },
83
89
  ],
90
+ paddingRight: Spacing.XXS,
84
91
  },
85
92
  ]}
86
93
  color={Colors.black_01}
@@ -88,7 +95,12 @@ const BadgeRibbon: FC<BadgeRibbonProps> = ({
88
95
  {label}
89
96
  </Text>
90
97
  </View>
91
- <Skew />
98
+ <Image
99
+ source={{
100
+ uri: 'https://static.momocdn.net/app/img/kits/utils/Tail_4x.png',
101
+ }}
102
+ style={{width: 8, height: 16}}
103
+ />
92
104
  </View>
93
105
  );
94
106
  };
package/Shape.tsx CHANGED
@@ -1,51 +1,33 @@
1
1
  import React from 'react';
2
2
  import Svg, {G, Path} from 'react-native-svg';
3
+ import {Image} from '@momo-kits/foundation';
3
4
 
4
5
  const UpTail = () => {
5
6
  return (
6
- <Svg width="5px" height="20px" viewBox="0 0 5 20">
7
- <G stroke="none" strokeWidth={1} fill="none" fillRule="evenodd">
8
- <Path
9
- d="M0 0h2v4a2 2 0 01-2-2V0z"
10
- fill="#C41B24"
11
- transform="matrix(1 0 0 -1 0 4)"
12
- />
13
- <Path
14
- d="M5 2l-.001 15.998H2.651l-.261-.003-.208.004-.229.014-.119.01-.246.036C.843 18.189.05 18.855 0 20V6a4 4 0 014-4h1z"
15
- fill="#FA541C"
16
- transform="matrix(1 0 0 -1 0 22)"
17
- />
18
- </G>
19
- </Svg>
7
+ <Image
8
+ resizeMode={'stretch'}
9
+ source={{
10
+ uri: 'https://static.momocdn.net/app/img/kits/utils/Head_down_4x.png',
11
+ }}
12
+ style={{
13
+ width: 5,
14
+ height: 20,
15
+ transform: [{rotate: '180deg'}],
16
+ }}
17
+ />
20
18
  );
21
19
  };
22
20
 
23
21
  const DownTail = () => {
24
22
  return (
25
- <Svg width="5px" height="20px" viewBox="0 0 5 20">
26
- <G stroke="none" strokeWidth={1} fill="none" fillRule="evenodd">
27
- <Path d="M0 16h2v4a2 2 0 01-2-2v-2z" fill="#C41B24" />
28
- <Path
29
- d="M5 0l-.001 15.998H2.651l-.261-.003-.208.004-.229.014-.119.01-.246.036C.843 16.189.05 16.855 0 18V4a4 4 0 014-4h1z"
30
- fill="#FA541C"
31
- />
32
- </G>
33
- </Svg>
23
+ <Image
24
+ resizeMode={'stretch'}
25
+ source={{
26
+ uri: 'https://static.momocdn.net/app/img/kits/utils/Head_4x.png',
27
+ }}
28
+ style={{width: 5, height: 20}}
29
+ />
34
30
  );
35
31
  };
36
32
 
37
- const Skew = () => {
38
- return (
39
- <Svg width="4px" height="16px" viewBox="0 0 4 16">
40
- <Path
41
- d="M3 0a1 1 0 011 1v1.143L.2 8 4 14v1a1 1 0 01-1 1H0V0h3z"
42
- fill="#FA541C"
43
- stroke="none"
44
- strokeWidth={1}
45
- fillRule="evenodd"
46
- />
47
- </Svg>
48
- );
49
- };
50
-
51
- export {UpTail, DownTail, Skew};
33
+ export {UpTail, DownTail};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/badge",
3
- "version": "0.81.18",
3
+ "version": "0.81.19",
4
4
  "private": false,
5
5
  "main": "index.tsx",
6
6
  "peerDependencies": {
@@ -14,4 +14,4 @@
14
14
  },
15
15
  "license": "MoMo",
16
16
  "dependencies": {}
17
- }
17
+ }
package/styles.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import {StyleSheet} from 'react-native';
2
- import {Colors, Radius, Spacing} from '@momo-kits/foundation';
2
+ import {Colors, Radius, scaleSize, Spacing} from '@momo-kits/foundation';
3
3
 
4
4
  export default StyleSheet.create({
5
5
  badge: {
@@ -7,7 +7,7 @@ export default StyleSheet.create({
7
7
  borderRadius: Radius.M,
8
8
  justifyContent: 'center',
9
9
  alignItems: 'center',
10
- height: 16,
10
+ height: scaleSize(16),
11
11
  flexDirection: 'row',
12
12
  borderWidth: 1,
13
13
  borderColor: Colors.black_01,
@@ -33,6 +33,7 @@ export default StyleSheet.create({
33
33
  alignSelf: 'baseline',
34
34
  flexDirection: 'row',
35
35
  height: 20,
36
+ overflow: 'hidden',
36
37
  },
37
38
  ribbonContent: {
38
39
  height: 16,
@@ -40,6 +41,7 @@ export default StyleSheet.create({
40
41
  alignItems: 'center',
41
42
  borderBottomRightRadius: 12,
42
43
  borderTopRightRadius: 12,
44
+ paddingRight: Spacing.S,
43
45
  },
44
46
  ribbonSkewContent: {
45
47
  height: 16,
@@ -48,7 +50,6 @@ export default StyleSheet.create({
48
50
  },
49
51
  ribbonLabel: {
50
52
  color: Colors.black_01,
51
- marginRight: Spacing.S,
52
53
  fontWeight: 'bold',
53
54
  },
54
55
  });