-
Notifications
You must be signed in to change notification settings - Fork 15
Interpolate overlay opacity #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Interpolate overlay opacity #7
Conversation
This is a great addition. Very similar to how the DrawerLayout.overlayColor works. @alessiocancian any chance this PR can be merged? |
Seems like the repository isn't actively maintained. For the time being, I have created a fork, merged this PR on it, updated the docs, and published on npm at @chakrahq/react-native-side-menu. Might help someone else who comes here looking for this. |
You're right, sorry, I'm not using this library anymore and currently not even react-native, so it's hard for me to test PRs and fix issues, I can reference your fork in the readme if you'd like to keep on maintaining the library. |
Sure, I can take it up. We have already added this in our production app, so maintaining it will be part of the process anyways. Also, thanks for maintaining it till now :) We really could not find any alternative that does not use reanimated internally. |
Hi, can you show me how to make the new function you make (animateOverlayOpacity) to work? I tried installing your folk and it work like the original but the new function didn't even show up on VSCode Intellisense and not working too. |
You're right. There seems to be issue when |
Hi @shobhitsinghal624 thank you for keeping up the maintenance of this library. |
Thank you for the heads up. The issues tab is enabled now. |
This PR allows the content overlay to fade in and out by interpolating the
left
Animated.Value to the opacity style prop on the overlay. It adds two new props to the component:overlayOpacity: number
with a default of1
animateOverlayOpacity: bool
with a default oftrue
and finally, it changes the rendering to always render the overlay, and adds a toggle on
pointerEvents
to determine if the overlay is interactive or if touches should simply pass through the overlay to main content.Here's what it looks like before the PR:
https://user-images.githubusercontent.com/80355384/125297478-e1991f80-e2ec-11eb-8962-46f4b7aa7971.mov
with the code:
and here's what it looks like after the PR:
https://user-images.githubusercontent.com/80355384/125297549-ef4ea500-e2ec-11eb-8bdd-5b7c1f76f759.mov
with the code:
If this PR and approach is welcome, I'll update the docs in the Readme as well.
Thanks for your time and consideration!