-
Notifications
You must be signed in to change notification settings - Fork 48
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
Platform-Agnostic Support #38
Comments
Hey @enaluz! First and foremost: happy new year and thanks a lot for the kind words, very much appreciated! You stand completely right in your statement about React's spirit, but unfortunately, we're a little bit biased at colorfy in that regard. If you've been through the documentation, you may have spotted that this library was created to fix a problem we were facing, and that's exactly were the biased part comes into play. We're mainly working on mobile apps so there's no prerogative for us to invest in web support for now as we won't be actively using it, debugging it, adding new features, etc by being our own primary testers. That being said, your help would be very much appreciated if you feel like you could undertake this task. I just very briefly went through the code and the non-exhaustive list of tasks I found would require us to:
And I believe that should be it. There might be some unforeseen blockers or steps I forgot as it's been a while since I've published a library for the web, so feel free to add to this list. Let me know if you'd be interested in working on this, even for a small aspect, your contribution would be more than welcome! |
FWIW, I just dropped this into an Expo 40 app and it worked with minor modifications for ios/android/web. It appears that all of the peerDeps are supported. As of 2.0, reanimated is also web ready. 🥳 Expo
Bare app w/ React Native WebNada! Integration StepsTo make modalfy work on web, you'll want to create a wrapper for the provider that introduces a view. The following wrapper creates the "fixed" view for the ModalProvider. There's very little fancy stuff going on here. Since modalfy uses a translateY, we need to disable overflow at the level we introduce the modal provider. This could probably be put in modalfy's provider, but until then this is a trivial workaround. import { View } from "react-native";
import { ModalProvider, createModalStack } from "react-native-modalfy";
export const Provider = (props) => (
<View style={{ overflow: "hidden", height: "100vh", width: "100vw" }}>
<ModalProvider stack={stack} {...props} />
</View>
); |
Hey @jakobo! Thanks so much for the very detailed comment! It looks like it's gonna be less cumbersome than I initially thought 😄 I'm going to implement the wrapper change you mentioned and set up a module bundler for the Web. We'll release a new version with just those changes and see how it works for people. That being said, it's good to know about the RNGH 1.9.0 issue! Based on our current workload at colorfy, I'd say the next version would have been out during March anyway so just in case, might as well wait for Expo 41. Thank you once again, will let you know as soon as |
No problem. Glad it's useful. A few other notes to consider (none of them critical) Regarding the ModalStack / Provider: I'd recommend applying the view styles only when the modal interface is open. react-native-web technically allows scrolling to occur on the body element. This also means that the Regarding the bundler options: I'd seriously consider just doing a babel/tscompile into a |
Hey @enaluz @jakobo! Thank you for your patience! It took (quite) some time but I finally managed to invest some time to work on this issue and implement Web support! This is available as of now in Modalfy v3 which is fresh off the press 🥳 Please give it a try and let us know how it works on Web! Special shoutout goes to you @jakobo for your help looking into this 🙌 I mentioned your contribution in the release blog post. Of course, let me know if you'd prefer me not to! |
Great to see it released. Working fantastic, and it's great to see such a strong Modal option available! |
First of all, this is an amazing library. I love the state management rationale behind this, and I think all modal state should be handled this way.
One thing I wish this library did have is web support. In the spirit of React (with React being a platform-agnostic language for building UIs), it would be really cool to get web support for this. There doesn't seem to be many native dependencies here.
Can we abstract this out to be mostly platform agnostic? How can I help with this effort?
The text was updated successfully, but these errors were encountered: