Skip to content

Commit

Permalink
fix: 【Steps】增加lineStyle
Browse files Browse the repository at this point in the history
  • Loading branch information
ChenlingasMx committed Aug 22, 2023
1 parent 1b50409 commit 2270a8a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions packages/core/src/Steps/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { View, StyleSheet, TouchableOpacity } from 'react-native';
import { View, StyleSheet, TouchableOpacity, ViewStyle } from 'react-native';
import { ViewProps } from 'react-native';
import Icon from '../Icon';
import Text from '../Typography/Text';
Expand All @@ -19,6 +19,7 @@ export interface StepsProps extends ViewProps {
items: StepsItemsProps[];
current?: number;
onChange?: (value: number) => void;
lineStyle?: ViewStyle;
}

export default (props: StepsProps) => {
Expand All @@ -41,17 +42,17 @@ export default (props: StepsProps) => {
return (
<TouchableOpacity style={[styles.item]} key={index} onPress={() => onStepsPress(index)}>
<View style={styles.wrap}>
{index !== 0 && <View style={styles.leftLine}></View>}
{index !== 0 && <View style={[styles.leftLine, { ...props.lineStyle }]}></View>}
{item.render}
{index < items.length - 1 && <View style={styles.rightLine}></View>}
{index < items.length - 1 && <View style={[styles.rightLine, { ...props.lineStyle }]}></View>}
</View>
</TouchableOpacity>
);
}
return (
<TouchableOpacity style={[styles.item]} key={index} onPress={() => onStepsPress(index)}>
<View style={styles.wrap}>
{index !== 0 && <View style={styles.leftLine}></View>}
{index !== 0 && <View style={[styles.leftLine, { ...props.lineStyle }]}></View>}
<View
style={[
styles.circular,
Expand All @@ -77,7 +78,7 @@ export default (props: StepsProps) => {
</Text>
)}
</View>
{index < items.length - 1 && <View style={styles.rightLine}></View>}
{index < items.length - 1 && <View style={[styles.rightLine, { ...props.lineStyle }]}></View>}
</View>
<Text color="primary_text">{item.title}</Text>
<Text color="text" style={styles.desc}>
Expand Down

0 comments on commit 2270a8a

Please sign in to comment.