Skip to content

Commit 2270a8a

Browse files
committedAug 22, 2023
fix: 【Steps】增加lineStyle
1 parent 1b50409 commit 2270a8a

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed
 

‎packages/core/src/Steps/index.tsx

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { View, StyleSheet, TouchableOpacity } from 'react-native';
2+
import { View, StyleSheet, TouchableOpacity, ViewStyle } from 'react-native';
33
import { ViewProps } from 'react-native';
44
import Icon from '../Icon';
55
import Text from '../Typography/Text';
@@ -19,6 +19,7 @@ export interface StepsProps extends ViewProps {
1919
items: StepsItemsProps[];
2020
current?: number;
2121
onChange?: (value: number) => void;
22+
lineStyle?: ViewStyle;
2223
}
2324

2425
export default (props: StepsProps) => {
@@ -41,17 +42,17 @@ export default (props: StepsProps) => {
4142
return (
4243
<TouchableOpacity style={[styles.item]} key={index} onPress={() => onStepsPress(index)}>
4344
<View style={styles.wrap}>
44-
{index !== 0 && <View style={styles.leftLine}></View>}
45+
{index !== 0 && <View style={[styles.leftLine, { ...props.lineStyle }]}></View>}
4546
{item.render}
46-
{index < items.length - 1 && <View style={styles.rightLine}></View>}
47+
{index < items.length - 1 && <View style={[styles.rightLine, { ...props.lineStyle }]}></View>}
4748
</View>
4849
</TouchableOpacity>
4950
);
5051
}
5152
return (
5253
<TouchableOpacity style={[styles.item]} key={index} onPress={() => onStepsPress(index)}>
5354
<View style={styles.wrap}>
54-
{index !== 0 && <View style={styles.leftLine}></View>}
55+
{index !== 0 && <View style={[styles.leftLine, { ...props.lineStyle }]}></View>}
5556
<View
5657
style={[
5758
styles.circular,
@@ -77,7 +78,7 @@ export default (props: StepsProps) => {
7778
</Text>
7879
)}
7980
</View>
80-
{index < items.length - 1 && <View style={styles.rightLine}></View>}
81+
{index < items.length - 1 && <View style={[styles.rightLine, { ...props.lineStyle }]}></View>}
8182
</View>
8283
<Text color="primary_text">{item.title}</Text>
8384
<Text color="text" style={styles.desc}>

0 commit comments

Comments
 (0)
Please sign in to comment.