@momo-kits/progress-info 0.153.2 → 0.154.1-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.
@@ -1,8 +1,14 @@
1
- import {Colors, Icon, Text} from '@momo-kits/foundation';
2
- import React, {FC} from 'react';
3
- import {View} from 'react-native';
1
+ import {
2
+ Colors,
3
+ Icon,
4
+ Text,
5
+ useScaleSize,
6
+ Radius,
7
+ } from '@momo-kits/foundation';
8
+ import React, { FC } from 'react';
9
+ import { StyleSheet, View, ViewStyle } from 'react-native';
4
10
  import styles from './styles';
5
- import {ProgressInfoItemIcon} from './types';
11
+ import { ProgressInfoItemIcon } from './types';
6
12
 
7
13
  const ProgressInfoIcon: FC<ProgressInfoItemIcon> = ({
8
14
  size = 'large',
@@ -13,12 +19,22 @@ const ProgressInfoIcon: FC<ProgressInfoItemIcon> = ({
13
19
  customIcon,
14
20
  index,
15
21
  }) => {
16
- let iconStyle = styles.stepIcon;
22
+ const size16 = useScaleSize(16);
23
+ const scaledRadiusM = useScaleSize(Radius.M);
24
+
25
+ let iconStyle: ViewStyle = styles.stepIcon;
17
26
  let checkIconSize = 16;
18
27
  let contentIconSize = 8;
19
28
 
20
29
  if (size === 'small') {
21
- iconStyle = styles.stepIconSmall;
30
+ iconStyle = StyleSheet.flatten([
31
+ styles.stepIcon,
32
+ {
33
+ width: size16,
34
+ height: size16,
35
+ borderRadius: scaledRadiusM,
36
+ },
37
+ ]);
22
38
  checkIconSize = 12;
23
39
  contentIconSize = 6;
24
40
  }
@@ -28,9 +44,10 @@ const ProgressInfoIcon: FC<ProgressInfoItemIcon> = ({
28
44
  if (useNumber) {
29
45
  return (
30
46
  <Text
31
- style={{position: 'absolute'}}
47
+ style={{ position: 'absolute' }}
32
48
  typography={'header_xs_semibold'}
33
- color={Colors.pink_MoMo_Branding}>
49
+ color={Colors.pink_MoMo_Branding}
50
+ >
34
51
  {index + 1}
35
52
  </Text>
36
53
  );
@@ -49,14 +66,20 @@ const ProgressInfoIcon: FC<ProgressInfoItemIcon> = ({
49
66
  // render default Icon
50
67
  return (
51
68
  <View
52
- style={[styles.currIcon, {width: contentIconSize, aspectRatio: 1}]}
69
+ style={[styles.currIcon, { width: contentIconSize, aspectRatio: 1 }]}
53
70
  />
54
71
  );
55
72
  };
56
73
 
57
74
  return (
58
75
  <View
59
- style={[iconStyle, styles.center, {backgroundColor, borderColor}, style]}>
76
+ style={[
77
+ iconStyle,
78
+ styles.center,
79
+ { backgroundColor, borderColor },
80
+ style,
81
+ ]}
82
+ >
60
83
  {renderIcon()}
61
84
  </View>
62
85
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/progress-info",
3
- "version": "0.153.2",
3
+ "version": "0.154.1-beta.1",
4
4
  "private": false,
5
5
  "main": "index.tsx",
6
6
  "dependencies": {},
package/styles.ts CHANGED
@@ -1,4 +1,4 @@
1
- import {Colors, Radius, scaleSize, Spacing} from '@momo-kits/foundation';
1
+ import {Colors, Radius, Spacing} from '@momo-kits/foundation';
2
2
  import {StyleSheet} from 'react-native';
3
3
  export default StyleSheet.create({
4
4
  stepIcon: {
@@ -7,12 +7,6 @@ export default StyleSheet.create({
7
7
  borderWidth: 2,
8
8
  borderRadius: Radius.L,
9
9
  },
10
- stepIconSmall: {
11
- width: scaleSize(16),
12
- height: scaleSize(16),
13
- borderWidth: 2,
14
- borderRadius: scaleSize(Radius.M),
15
- },
16
10
  lineHorizontal: {
17
11
  height: 2,
18
12
  flex: 1,
@@ -44,14 +38,6 @@ export default StyleSheet.create({
44
38
  textCenter: {
45
39
  textAlign: 'center',
46
40
  },
47
- largeText: {
48
- fontSize: scaleSize(12),
49
- lineHeight: scaleSize(16),
50
- },
51
- smallText: {
52
- fontSize: scaleSize(8),
53
- lineHeight: scaleSize(12),
54
- },
55
41
  currIcon: {
56
42
  backgroundColor: Colors.pink_MoMo_Branding,
57
43
  borderRadius: Radius.L,