react-native-looped-carousel
react-native-looped-carousel copied to clipboard
Add option to set images for arrows
Allows for setting arrows to images. Warns if text and image props are both set. Image takes priority.
Props added:
leftArrowImagerightArrowImagearrowImageStyle
Would you still want to keep the leftArrowText/rightArrowText props? I was trying to keep with the simplicity of the text props, but I could remove [left/right]Arrow[Text/Image] props and add a leftArrowComponent and rightArrowComponent instead. Or even keep all three, and give priority as Component > Image > Text.
I'll of course fix the conflicts that have popped up as well, just want to get a feel for how you think the arrows props should look.
Hi @benkane, I was thinking about allowing only elements at some point to simplify api, and deprecating leftArrowText, rightArrowText, leftArrowStyle, rightArrowStyle, etc..
so in the end it should look like
<Carousel
leftArrow={<Image source={'./left.png'}/>}
rightArrow={<Image source={'./right.png'}/>}
>
...
</Carousel>;
So, with this approach it's possible to use images, text or whatever custom things you wish ^_^
Thanks @phil-r, I'll take a look at implementing something like that when I get some time.