Skip to content
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

⭐️ Support Detents for Page Sheet for Improved Bottom Sheet UX #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

trevorwhealy
Copy link

Proposal to include this new behavior in iOS 15 to make bottom sheets.

This is pseudocode, just seems like the correct place to extend the behavior.

The parent API would also need additional prop changes to support this.

For achieving UIs that look like this:

Proposal to include the bottom sheet. This is mostly pseudocode.
@dominicstop
Copy link
Owner

dominicstop commented Dec 20, 2021

Hello!! Thank you for making this, i really appreciate it — i already plan on adding this feature in the future (but it'll require Xcode 12)


I'll implement this after the typescript + swift re-write haha — I'll have to transfer over the "view controller" logic from react-native-ios-navigator, first though, and fix the current bugs (I'm also experimenting with C++ native modules i.e. TurboModules).


I'll update you once I've finished implementing this feature ✨


(the earliest I can promise is the 1st week of January next year)

@trevorwhealy
Copy link
Author

@dominicstop of course - nice work on this great library by the way. I was trying to build something similar for a few weeks, but your implementation is more robust and complete. In my version, I was really trying to keep the API small since I'm not as comfortable with Swift. Something like this:

import { promptNativeBottomSheet, dismissNativeBottomSheet, NativeBottomSheet } = NativeModules

const App = () => {
   return <View>
      <Button onPress={() => promptNativeBottomSheet(1)} title="Prompt bottom sheet" />
      <NativeBottomSheet id={1}>
          <Button onPress={() => dismissNativeBottomSheet(1)} title="Dismiss bottom sheet" />
      </NativeBottomSheet>
   </View>
}

Alternatively tried something like this, but keeping track of the visibility flag across the bridge was kind of awkward.

import { NativeBottomSheet } = NativeModules

const App = () => {
   const [isVisible, setIsVisible] = useState(false)
   return <View>
      <Button onPress={() => setIsVisible(true)} title="Press me" />
      <NativeBottomSheet isVisible={isVisible} onDismiss={() => setIsVisible(false)} />
   </View>
}

Early January would be a pretty quick turnaround actually. Please feel free to message me anytime between then, now, or after, if you want me to help test out the implementation!

@dominicstop
Copy link
Owner

I would love help with testing actually haha — I'll update you with the progress via this thread.


I'm going to start working on it after I'm done refactoring the docs for react-native-ios-context-menu

@vbylen
Copy link

vbylen commented Jan 28, 2022

Hey @dominicstop, it seems like your iOS modal is pretty much the best one out there. When I saw the proposed improvements I got even more excited. Please do let us know your progress, or if you need any help.

@nandorojo
Copy link
Collaborator

There is an open PR on the React Native repo for this too for reference: facebook/react-native#34834

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants