Skip to content

Commit 009642f

Browse files
authored
Dash - passing default color as modifier (#2841)
1 parent eab3426 commit 009642f

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/components/dash/index.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React, {useState, useCallback, useMemo} from 'react';
22
import {StyleSheet, StyleProp, ViewProps, ViewStyle, LayoutChangeEvent} from 'react-native';
33
import View from '../view';
4-
import {Colors} from '../../style';
54

65
//TODO: move to some global types (shared with Timeline component)
76
export type Layout = {
@@ -35,11 +34,10 @@ const Dash = (props: DashProps) => {
3534
width: vertical ? thickness : length,
3635
height: vertical ? length : thickness,
3736
marginRight: vertical ? 0 : gap,
38-
marginBottom: vertical ? gap : 0,
39-
backgroundColor: color
37+
marginBottom: vertical ? gap : 0
4038
};
4139
return [style, _style];
42-
}, [vertical, length, thickness, gap, color, style]);
40+
}, [vertical, length, thickness, gap, style]);
4341

4442
const lineStyle = useMemo(() => {
4543
const directionStyle = vertical ? styles.column : styles.row;
@@ -56,7 +54,7 @@ const Dash = (props: DashProps) => {
5654
const dash = [];
5755

5856
for (let i = 0; i < n; i++) {
59-
dash.push(<View key={i} style={dashStyle}/>);
57+
dash.push(<View key={i} bg-$outlineDefault backgroundColor={color} style={dashStyle}/>);
6058
}
6159

6260
return dash;
@@ -73,8 +71,7 @@ export default Dash;
7371
Dash.defaultProps = {
7472
gap: 6,
7573
length: 6,
76-
thickness: 2,
77-
color: Colors.black
74+
thickness: 2
7875
};
7976

8077
const styles = StyleSheet.create({

0 commit comments

Comments
 (0)