obipawan / react-native-dash

A super simple <Dash /> component for react-native to draw customisable dashed lines
176 stars 63 forks source link

rounded dots instead of dashes #3

Closed RobbyAI closed 7 years ago

RobbyAI commented 7 years ago

add a 'rounded' property to allow the creation of rounded dots instead of the default straight lines dashes

obipawan commented 7 years ago

Hey @superbibi | @BricePissard thanks a lot for the addition 👍 . I realised that this can be simplified by moving the styles for the dashes as a style prop to the component. The only props <Dash /> would need is dashGap, dashLength, dashThickness & a new dashStyle (View.propTypes.style)

https://github.com/obipawan/react-native-dash/blob/master/Dash.js#L31 should become

<View key={ i } style={ [ dashStyle, { width, height, marginRight, marginBottom } ] }/>

& the usage would become flexible as

<Dash
        ..
    dashStyle={ { backgroundColor: 'black', borderRadius: 100, overflow: 'hidden'  } }
    style={ .. }
/>

I find this as a better option by keeping <Dash /> agnostic about the styling, so usage is free to style it any way it chooses to :) I understand this is somewhat different than you're addition, but i'll highly appreciate if you'll be willing to make this change :)

Thanks much!

obipawan commented 7 years ago

Thanks a ton @superbibi | @BricePissard 👍