cbbfcd / react-native-lightbox

Images etc in Full Screen Lightbox Popovers for React Native
MIT License
63 stars 27 forks source link

feat: add renderItem #4

Closed demedos closed 2 years ago

demedos commented 2 years ago

Adds the renderItem method, which can be used to display a custom element instead of children. This is extremely useful for having a custom trigger element, e.g. a button above an image, and is fully backward compatible.

It also fixes the typescript return types of the renderHeader and renderContent methods, which should return a JSX.Element instead of void.

https://user-images.githubusercontent.com/16702156/153588340-954f4820-2c3b-4d6d-8dbb-7ca48ec77940.mov

demedos commented 2 years ago

@cbbfcd this is based on v0.8.8 which is the latest released npm package

cbbfcd commented 2 years ago

I have been a little busy recently, sorry, I will review all the codes in the past two days, and I will continue to invest in improving this project in the future, thank you~ @demedos

cbbfcd commented 2 years ago

This branch has conflicts that must be resolved

@demedos 😂

demedos commented 2 years ago

Hi @cbbfcd , I know that this conflicts with master, but this is supposed to be a v0.9.0 based off the current npm release which is v0.8.8

demedos commented 2 years ago

It would be great if you could create a v0.9.0 based off the v0.8.8 tag, merge the PRs (this, https://github.com/cbbfcd/react-native-lightbox/pull/5 and https://github.com/cbbfcd/react-native-lightbox/pull/6) and release it to npm 😉 It would be a minor bump because the API has been extended

demedos commented 2 years ago

Hey @cbbfcd , thank you for the new release. mind adding those changes too?

cbbfcd commented 2 years ago

@demedos If you have time, can you make a new PR based on 0.9.0? thx~

demedos commented 2 years ago

yeah sure, I'll do this in the next few days

demedos commented 2 years ago

I'm sorry but I just noticed that https://github.com/cbbfcd/react-native-lightbox/pull/5 and https://github.com/cbbfcd/react-native-lightbox/pull/6 has ported into master rather than being created as a new tag starting off v0.8.9. master seems to be a complete rewrite with many changes and API improvements, but it is not retro compatible. Mind creating a new branch based off v0.8.9? I will then submit the 3 PRs towards that branch, and you could invalidate v0.9.0 and create + release v0.9.1. You can add me as a contributor if you want help with that

cbbfcd commented 2 years ago

What if it is implemented directly based on the current master code? 👀

alessioemireni commented 2 years ago

+1

demedos commented 2 years ago

What if it is implemented directly based on the current master code? 👀

closing in favor of https://github.com/cbbfcd/react-native-lightbox/pull/9