react-native-looped-carousel icon indicating copy to clipboard operation
react-native-looped-carousel copied to clipboard

Add option to set images for arrows

Open benkane opened this issue 8 years ago • 3 comments

Allows for setting arrows to images. Warns if text and image props are both set. Image takes priority.

Props added:

  • leftArrowImage
  • rightArrowImage
  • arrowImageStyle

benkane avatar Oct 02 '17 15:10 benkane

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.

benkane avatar Apr 03 '18 15:04 benkane

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 ^_^

phil-r avatar Apr 08 '18 11:04 phil-r

Thanks @phil-r, I'll take a look at implementing something like that when I get some time.

benkane avatar Apr 09 '18 18:04 benkane