@momo-kits/step 0.103.2-rc.2 → 0.103.2-rc.21
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/StepIcon.tsx +44 -16
- package/StepsHorizontal.tsx +45 -29
- package/StepsVertical.tsx +32 -18
- package/index.tsx +2 -2
- package/package.json +1 -1
- package/styles.ts +6 -2
- package/types.ts +28 -2
- package/utils.ts +14 -15
package/StepIcon.tsx
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import {Colors, Icon, Text} from '@momo-kits/foundation';
|
|
1
2
|
import React, {FC} from 'react';
|
|
2
3
|
import {View} from 'react-native';
|
|
3
|
-
import {StepIconProps} from './types';
|
|
4
4
|
import styles from './styles';
|
|
5
|
-
import {
|
|
5
|
+
import {StepIconProps} from './types';
|
|
6
6
|
|
|
7
7
|
const StepIcon: FC<StepIconProps> = ({
|
|
8
8
|
size = 'large',
|
|
@@ -12,34 +12,62 @@ const StepIcon: FC<StepIconProps> = ({
|
|
|
12
12
|
style,
|
|
13
13
|
useNumber,
|
|
14
14
|
index,
|
|
15
|
+
isActive,
|
|
16
|
+
customIcon,
|
|
15
17
|
}) => {
|
|
16
18
|
let iconStyle = styles.stepIcon;
|
|
17
19
|
let checkIconSize = 16;
|
|
18
|
-
let
|
|
20
|
+
let contentIconSize = 8;
|
|
19
21
|
|
|
20
22
|
if (size === 'small') {
|
|
21
23
|
iconStyle = styles.stepIconSmall;
|
|
22
24
|
checkIconSize = 12;
|
|
25
|
+
contentIconSize = 6;
|
|
23
26
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
|
|
28
|
+
let iconSource = error ? 'navigation_close' : 'notifications_check';
|
|
29
|
+
|
|
30
|
+
const renderIcon = () => {
|
|
31
|
+
// useNumber is true, render number
|
|
32
|
+
if (useNumber) {
|
|
33
|
+
return (
|
|
28
34
|
<Text
|
|
29
|
-
style={{
|
|
30
|
-
position: 'absolute',
|
|
31
|
-
}}
|
|
35
|
+
style={{position: 'absolute'}}
|
|
32
36
|
typography={'header_xs_semibold'}
|
|
33
37
|
color={Colors.black_01}>
|
|
34
38
|
{index + 1}
|
|
35
39
|
</Text>
|
|
36
|
-
)
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (isActive) {
|
|
44
|
+
// customIcon is true, render customIcon
|
|
45
|
+
if (customIcon) {
|
|
46
|
+
return (
|
|
47
|
+
<Icon
|
|
48
|
+
size={checkIconSize}
|
|
49
|
+
color={Colors.black_01}
|
|
50
|
+
source={customIcon}
|
|
51
|
+
/>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
// render default Icon
|
|
55
|
+
return (
|
|
56
|
+
<View
|
|
57
|
+
style={[styles.currIcon, {width: contentIconSize, aspectRatio: 1}]}
|
|
41
58
|
/>
|
|
42
|
-
)
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return (
|
|
63
|
+
<Icon size={checkIconSize} color={Colors.black_01} source={iconSource} />
|
|
64
|
+
);
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
return (
|
|
68
|
+
<View
|
|
69
|
+
style={[iconStyle, styles.center, {backgroundColor, borderColor}, style]}>
|
|
70
|
+
{renderIcon()}
|
|
43
71
|
</View>
|
|
44
72
|
);
|
|
45
73
|
};
|
package/StepsHorizontal.tsx
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import {ApplicationContext, Colors, Spacing, Text} from '@momo-kits/foundation';
|
|
2
|
+
import React, {FC, useContext} from 'react';
|
|
3
|
+
import {FlexAlignType, TouchableOpacity, View} from 'react-native';
|
|
4
4
|
import StepIcon from './StepIcon';
|
|
5
|
-
import {Spacing, Text} from '@momo-kits/foundation';
|
|
6
|
-
import {getStepColor, getStepTypo} from './utils';
|
|
7
5
|
import styles from './styles';
|
|
6
|
+
import {Step, StepsProps} from './types';
|
|
7
|
+
import {getStepColor, getStepTypo} from './utils';
|
|
8
8
|
|
|
9
9
|
type TextAlign = 'left' | 'right' | 'center';
|
|
10
10
|
|
|
@@ -14,10 +14,14 @@ const StepsHorizontal: FC<StepsProps> = ({
|
|
|
14
14
|
activeIndex,
|
|
15
15
|
useNumber = false,
|
|
16
16
|
align = 'center',
|
|
17
|
+
customIcon,
|
|
18
|
+
onPress,
|
|
19
|
+
disabled,
|
|
17
20
|
}) => {
|
|
18
|
-
const renderStepItem = (
|
|
19
|
-
const {title, description, error, time} =
|
|
20
|
-
let typoStyle = getStepTypo(activeIndex,
|
|
21
|
+
const renderStepItem = (item: Step, index: number) => {
|
|
22
|
+
const {title, description, error, time} = item;
|
|
23
|
+
let typoStyle = getStepTypo(activeIndex, index, error, size);
|
|
24
|
+
const {theme} = useContext(ApplicationContext);
|
|
21
25
|
let alignItems: FlexAlignType = 'center';
|
|
22
26
|
let textAlign: TextAlign = 'center';
|
|
23
27
|
|
|
@@ -28,39 +32,41 @@ const StepsHorizontal: FC<StepsProps> = ({
|
|
|
28
32
|
alignItems = 'flex-end';
|
|
29
33
|
textAlign = 'right';
|
|
30
34
|
} else if (align === 'stretch') {
|
|
31
|
-
if (
|
|
35
|
+
if (index === 0) {
|
|
32
36
|
alignItems = 'flex-start';
|
|
33
37
|
textAlign = 'left';
|
|
34
|
-
} else if (
|
|
38
|
+
} else if (index === steps.length - 1) {
|
|
35
39
|
textAlign = 'right';
|
|
36
40
|
alignItems = 'flex-end';
|
|
37
41
|
}
|
|
38
42
|
}
|
|
39
43
|
|
|
40
44
|
const haveMarginRight =
|
|
41
|
-
|
|
45
|
+
index !== steps.length - 1 && align !== 'center' && align !== 'stretch';
|
|
42
46
|
|
|
43
47
|
return (
|
|
44
|
-
<
|
|
45
|
-
key={`Step ${
|
|
48
|
+
<TouchableOpacity
|
|
49
|
+
key={`Step ${index}`}
|
|
46
50
|
style={{
|
|
47
51
|
flex: 1,
|
|
48
52
|
alignItems,
|
|
49
53
|
marginRight: haveMarginRight ? Spacing.XS : 0,
|
|
50
|
-
}}
|
|
54
|
+
}}
|
|
55
|
+
disabled={disabled || !onPress}
|
|
56
|
+
onPress={onPress}>
|
|
51
57
|
{!!time && (
|
|
52
58
|
<Text
|
|
53
59
|
style={{textAlign}}
|
|
54
|
-
color={typoStyle.time.color}
|
|
60
|
+
color={disabled ? theme.colors.text.disable : typoStyle.time.color}
|
|
55
61
|
typography={typoStyle.time.typography}>
|
|
56
62
|
{time}
|
|
57
63
|
</Text>
|
|
58
64
|
)}
|
|
59
|
-
{renderStepIcon(
|
|
65
|
+
{renderStepIcon(item, index, align, false)}
|
|
60
66
|
{!!title && (
|
|
61
67
|
<Text
|
|
62
68
|
style={[styles.title, {textAlign}]}
|
|
63
|
-
color={typoStyle.title.color}
|
|
69
|
+
color={disabled ? theme.colors.text.disable : typoStyle.title.color}
|
|
64
70
|
typography={typoStyle.title.typography}>
|
|
65
71
|
{title}
|
|
66
72
|
</Text>
|
|
@@ -68,25 +74,33 @@ const StepsHorizontal: FC<StepsProps> = ({
|
|
|
68
74
|
{!!description && (
|
|
69
75
|
<Text
|
|
70
76
|
style={{textAlign}}
|
|
71
|
-
color={
|
|
77
|
+
color={
|
|
78
|
+
disabled ? theme.colors.text.disable : typoStyle.description.color
|
|
79
|
+
}
|
|
72
80
|
typography={typoStyle.description.typography}>
|
|
73
81
|
{description}
|
|
74
82
|
</Text>
|
|
75
83
|
)}
|
|
76
|
-
</
|
|
84
|
+
</TouchableOpacity>
|
|
77
85
|
);
|
|
78
86
|
};
|
|
79
87
|
|
|
80
|
-
const renderStepIcon = (
|
|
81
|
-
|
|
88
|
+
const renderStepIcon = (
|
|
89
|
+
item: Step,
|
|
90
|
+
index: number,
|
|
91
|
+
align: string = 'center',
|
|
92
|
+
disabled: boolean
|
|
93
|
+
) => {
|
|
94
|
+
const {error} = item;
|
|
82
95
|
|
|
83
|
-
const stepStyle = getStepColor(activeIndex,
|
|
96
|
+
const stepStyle = getStepColor(activeIndex, index, error, steps.length);
|
|
84
97
|
const {backgroundColor, borderColor, lineColorRight, lineColorLeft} =
|
|
85
98
|
stepStyle;
|
|
86
99
|
|
|
87
|
-
const lineLeftHide =
|
|
100
|
+
const lineLeftHide =
|
|
101
|
+
(align === 'stretch' && index === 0) || align === 'left';
|
|
88
102
|
const lineRightHide =
|
|
89
|
-
(align === 'stretch' &&
|
|
103
|
+
(align === 'stretch' && index === steps.length - 1) || align === 'right';
|
|
90
104
|
|
|
91
105
|
return (
|
|
92
106
|
<View style={styles.rowStep}>
|
|
@@ -104,15 +118,17 @@ const StepsHorizontal: FC<StepsProps> = ({
|
|
|
104
118
|
<StepIcon
|
|
105
119
|
size={size}
|
|
106
120
|
error={error}
|
|
107
|
-
backgroundColor={backgroundColor}
|
|
108
|
-
borderColor={borderColor}
|
|
121
|
+
backgroundColor={disabled ? Colors.pink_08 : backgroundColor}
|
|
122
|
+
borderColor={disabled ? Colors.pink_10 : borderColor}
|
|
109
123
|
style={{
|
|
110
124
|
marginRight: !lineRightHide ? Spacing.XS : 0,
|
|
111
125
|
marginLeft: !lineLeftHide ? Spacing.XS : 0,
|
|
112
126
|
marginVertical: Spacing.XS,
|
|
113
127
|
}}
|
|
114
|
-
index={
|
|
128
|
+
index={index}
|
|
115
129
|
useNumber={useNumber}
|
|
130
|
+
isActive={activeIndex === index}
|
|
131
|
+
customIcon={customIcon}
|
|
116
132
|
/>
|
|
117
133
|
{!lineRightHide && (
|
|
118
134
|
<View
|
|
@@ -131,8 +147,8 @@ const StepsHorizontal: FC<StepsProps> = ({
|
|
|
131
147
|
|
|
132
148
|
return (
|
|
133
149
|
<View style={{flexDirection: 'row'}}>
|
|
134
|
-
{steps.map((
|
|
135
|
-
return renderStepItem(
|
|
150
|
+
{steps.map((item, index) => {
|
|
151
|
+
return renderStepItem(item, index);
|
|
136
152
|
})}
|
|
137
153
|
</View>
|
|
138
154
|
);
|
package/StepsVertical.tsx
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import {ApplicationContext, Spacing, Text} from '@momo-kits/foundation';
|
|
1
2
|
import React, {FC, useContext} from 'react';
|
|
2
3
|
import {View} from 'react-native';
|
|
4
|
+
import StepIcon from './StepIcon';
|
|
5
|
+
import styles from './styles';
|
|
3
6
|
import {Step, StepsProps} from './types';
|
|
4
7
|
import {getStepColor, getStepTypo} from './utils';
|
|
5
|
-
import {ApplicationContext, Spacing, Text} from '@momo-kits/foundation';
|
|
6
|
-
import styles from './styles';
|
|
7
|
-
import StepIcon from './StepIcon';
|
|
8
8
|
|
|
9
9
|
const StepsVertical: FC<StepsProps> = ({
|
|
10
10
|
steps,
|
|
@@ -14,20 +14,37 @@ const StepsVertical: FC<StepsProps> = ({
|
|
|
14
14
|
}) => {
|
|
15
15
|
const {theme} = useContext(ApplicationContext);
|
|
16
16
|
|
|
17
|
-
const renderStepItem = (
|
|
18
|
-
const {error, description, title, time} =
|
|
17
|
+
const renderStepItem = (item: Step, index: number) => {
|
|
18
|
+
const {error, description, title, time} = item;
|
|
19
19
|
|
|
20
|
-
const stepStyle = getStepColor(activeIndex,
|
|
21
|
-
|
|
20
|
+
const stepStyle = getStepColor(activeIndex, index, error, steps.length);
|
|
21
|
+
const typoStyle = getStepTypo(activeIndex, index, error, size);
|
|
22
22
|
|
|
23
23
|
const {backgroundColor, borderColor} = stepStyle;
|
|
24
24
|
const lineColor =
|
|
25
|
-
activeIndex >
|
|
25
|
+
activeIndex > index
|
|
26
26
|
? theme.colors.primary + '33'
|
|
27
27
|
: theme.colors.background.default;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* build description
|
|
31
|
+
*/
|
|
32
|
+
const buildDescription = () => {
|
|
33
|
+
if (typeof description == 'string') {
|
|
34
|
+
return (
|
|
35
|
+
<Text
|
|
36
|
+
color={typoStyle.description.color}
|
|
37
|
+
typography={typoStyle.description.typography}>
|
|
38
|
+
{description}
|
|
39
|
+
</Text>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
return description;
|
|
43
|
+
};
|
|
44
|
+
|
|
28
45
|
return (
|
|
29
46
|
<View
|
|
30
|
-
key={`Step ${
|
|
47
|
+
key={`Step ${index}`}
|
|
31
48
|
style={{
|
|
32
49
|
flexDirection: 'row',
|
|
33
50
|
marginBottom: Spacing.XS,
|
|
@@ -44,9 +61,10 @@ const StepsVertical: FC<StepsProps> = ({
|
|
|
44
61
|
backgroundColor={backgroundColor}
|
|
45
62
|
borderColor={borderColor}
|
|
46
63
|
useNumber={useNumber}
|
|
47
|
-
index={
|
|
64
|
+
index={index}
|
|
65
|
+
isActive={activeIndex === index}
|
|
48
66
|
/>
|
|
49
|
-
{
|
|
67
|
+
{index !== steps.length - 1 && (
|
|
50
68
|
<View
|
|
51
69
|
style={[
|
|
52
70
|
styles.lineVertical,
|
|
@@ -76,19 +94,15 @@ const StepsVertical: FC<StepsProps> = ({
|
|
|
76
94
|
{time}
|
|
77
95
|
</Text>
|
|
78
96
|
</View>
|
|
79
|
-
|
|
80
|
-
color={typoStyle.description.color}
|
|
81
|
-
typography={typoStyle.description.typography}>
|
|
82
|
-
{description}
|
|
83
|
-
</Text>
|
|
97
|
+
{buildDescription()}
|
|
84
98
|
</View>
|
|
85
99
|
</View>
|
|
86
100
|
);
|
|
87
101
|
};
|
|
88
102
|
return (
|
|
89
103
|
<View style={{width: '100%'}}>
|
|
90
|
-
{steps.map((
|
|
91
|
-
return renderStepItem(
|
|
104
|
+
{steps.map((item, index: number) => {
|
|
105
|
+
return renderStepItem(item, index);
|
|
92
106
|
})}
|
|
93
107
|
</View>
|
|
94
108
|
);
|
package/index.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, {FC} from 'react';
|
|
2
2
|
import {View} from 'react-native';
|
|
3
|
-
import {Step, StepsProps} from './types';
|
|
3
|
+
import {Step, StepsProps, Align} from './types';
|
|
4
4
|
import StepsHorizontal from './StepsHorizontal';
|
|
5
5
|
import StepsVertical from './StepsVertical';
|
|
6
6
|
|
|
@@ -17,4 +17,4 @@ const Steps: FC<StepsProps> = ({horizontal = false, ...props}) => {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
export {Steps};
|
|
20
|
-
export type {StepsProps, Step};
|
|
20
|
+
export type {StepsProps, Step, Align};
|
package/package.json
CHANGED
package/styles.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {StyleSheet} from 'react-native';
|
|
2
1
|
import {Radius, scaleSize, Spacing} from '@momo-kits/foundation';
|
|
3
|
-
|
|
2
|
+
import {StyleSheet} from 'react-native';
|
|
4
3
|
export default StyleSheet.create({
|
|
5
4
|
stepIcon: {
|
|
6
5
|
width: 24,
|
|
@@ -53,4 +52,9 @@ export default StyleSheet.create({
|
|
|
53
52
|
fontSize: scaleSize(8),
|
|
54
53
|
lineHeight: scaleSize(12),
|
|
55
54
|
},
|
|
55
|
+
currIcon: {
|
|
56
|
+
backgroundColor: 'white',
|
|
57
|
+
borderRadius: Radius.L,
|
|
58
|
+
aspectRatio: 1,
|
|
59
|
+
},
|
|
56
60
|
});
|
package/types.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {ViewStyle} from 'react-native';
|
|
2
|
+
import React from 'react';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Properties for the Steps component, a guided progress through a sequence of procedural steps.
|
|
@@ -31,9 +32,17 @@ export type StepsProps = {
|
|
|
31
32
|
|
|
32
33
|
useNumber?: boolean;
|
|
33
34
|
|
|
34
|
-
align?:
|
|
35
|
+
align?: Align;
|
|
36
|
+
|
|
37
|
+
customIcon?: string;
|
|
38
|
+
|
|
39
|
+
onPress?: () => void;
|
|
40
|
+
|
|
41
|
+
disabled?: boolean;
|
|
35
42
|
};
|
|
36
43
|
|
|
44
|
+
export type Align = 'left' | 'right' | 'center' | 'stretch';
|
|
45
|
+
|
|
37
46
|
/**
|
|
38
47
|
* Represents a single step within the Steps component. Each step has a
|
|
39
48
|
* title and can have optional properties such as a description or error state.
|
|
@@ -48,7 +57,7 @@ export type Step = {
|
|
|
48
57
|
* Optional. More detailed text about this particular step.
|
|
49
58
|
* It can provide users with guidance on what to expect or what's required.
|
|
50
59
|
*/
|
|
51
|
-
description?: string;
|
|
60
|
+
description?: string | React.ReactNode;
|
|
52
61
|
|
|
53
62
|
/**
|
|
54
63
|
* Optional. If `true`, the step is marked as having an error, typically displayed
|
|
@@ -101,4 +110,21 @@ export type StepIconProps = {
|
|
|
101
110
|
useNumber?: boolean;
|
|
102
111
|
|
|
103
112
|
index: number;
|
|
113
|
+
|
|
114
|
+
isActive?: boolean;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Optional. Custom active icon
|
|
118
|
+
*/
|
|
119
|
+
customIcon?: string;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
export type ProgressInfoProps = {
|
|
123
|
+
steps: Step[];
|
|
124
|
+
horizontal?: boolean;
|
|
125
|
+
size?: 'small' | 'large';
|
|
126
|
+
useNumber?: boolean;
|
|
127
|
+
align?: 'left' | 'right' | 'center' | 'stretch' | undefined;
|
|
128
|
+
showDescription?: boolean;
|
|
129
|
+
customIcon?: string;
|
|
104
130
|
};
|
package/utils.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {useContext} from 'react';
|
|
2
1
|
import {ApplicationContext, Colors, Typography} from '@momo-kits/foundation';
|
|
2
|
+
import {useContext} from 'react';
|
|
3
3
|
|
|
4
|
-
type StepStatus = '
|
|
4
|
+
type StepStatus = 'incomplete' | 'current' | 'completed' | 'error';
|
|
5
5
|
type StepTypo = {
|
|
6
6
|
typography: Typography;
|
|
7
7
|
color: string;
|
|
@@ -11,7 +11,7 @@ export const getStepTypo = (
|
|
|
11
11
|
activeIndex: number,
|
|
12
12
|
currentIndex: number,
|
|
13
13
|
error?: boolean,
|
|
14
|
-
size?: 'small' | 'large'
|
|
14
|
+
size?: 'small' | 'large'
|
|
15
15
|
) => {
|
|
16
16
|
const {theme} = useContext(ApplicationContext);
|
|
17
17
|
|
|
@@ -28,27 +28,26 @@ export const getStepTypo = (
|
|
|
28
28
|
typography: 'description_xs_regular',
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
let status: StepStatus = '
|
|
31
|
+
let status: StepStatus = 'incomplete';
|
|
32
32
|
if (activeIndex > currentIndex) {
|
|
33
33
|
status = 'completed';
|
|
34
34
|
}
|
|
35
35
|
if (activeIndex === currentIndex) {
|
|
36
|
-
status = '
|
|
36
|
+
status = 'current';
|
|
37
37
|
}
|
|
38
38
|
if (error) {
|
|
39
39
|
status = 'error';
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
switch (status) {
|
|
43
|
-
case '
|
|
43
|
+
case 'current': {
|
|
44
|
+
title.color = theme.colors.primary;
|
|
44
45
|
title.typography = 'header_xs_semibold';
|
|
45
46
|
break;
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
case 'completed': {
|
|
49
|
-
title.
|
|
50
|
-
description.color = theme.colors.text.disable;
|
|
51
|
-
time.color = theme.colors.text.disable;
|
|
50
|
+
title.typography = 'header_xs_semibold';
|
|
52
51
|
break;
|
|
53
52
|
}
|
|
54
53
|
|
|
@@ -70,7 +69,7 @@ export const getStepColor = (
|
|
|
70
69
|
activeIndex: number,
|
|
71
70
|
currentIndex: number,
|
|
72
71
|
error?: boolean,
|
|
73
|
-
length: number = 1
|
|
72
|
+
length: number = 1
|
|
74
73
|
) => {
|
|
75
74
|
const {theme} = useContext(ApplicationContext);
|
|
76
75
|
const DEFAULT_LINE_COLOR = theme.colors.background.default;
|
|
@@ -80,7 +79,7 @@ export const getStepColor = (
|
|
|
80
79
|
let borderColor = theme.colors.border.default;
|
|
81
80
|
let lineColorLeft = DEFAULT_LINE_COLOR;
|
|
82
81
|
let lineColorRight = DEFAULT_LINE_COLOR;
|
|
83
|
-
let status: StepStatus = '
|
|
82
|
+
let status: StepStatus = 'incomplete';
|
|
84
83
|
|
|
85
84
|
if (activeIndex > currentIndex) {
|
|
86
85
|
status = 'completed';
|
|
@@ -88,7 +87,7 @@ export const getStepColor = (
|
|
|
88
87
|
lineColorRight = COMPLETED_LINE_COLOR;
|
|
89
88
|
}
|
|
90
89
|
if (activeIndex === currentIndex) {
|
|
91
|
-
status = '
|
|
90
|
+
status = 'current';
|
|
92
91
|
lineColorLeft = COMPLETED_LINE_COLOR;
|
|
93
92
|
}
|
|
94
93
|
if (error) {
|
|
@@ -103,15 +102,15 @@ export const getStepColor = (
|
|
|
103
102
|
}
|
|
104
103
|
|
|
105
104
|
switch (status) {
|
|
106
|
-
case '
|
|
105
|
+
case 'current': {
|
|
107
106
|
backgroundColor = theme.colors.primary;
|
|
108
107
|
borderColor = theme.colors.background.tonal;
|
|
109
108
|
break;
|
|
110
109
|
}
|
|
111
110
|
|
|
112
111
|
case 'completed': {
|
|
113
|
-
backgroundColor = theme.colors.primary
|
|
114
|
-
borderColor = theme.colors.background.
|
|
112
|
+
backgroundColor = theme.colors.primary;
|
|
113
|
+
borderColor = theme.colors.background.tonal;
|
|
115
114
|
break;
|
|
116
115
|
}
|
|
117
116
|
|