Page MenuHomePhabricator

[native] make bottomsheet snap point dynamic
ClosedPublic

Authored by ginsu on Sep 24 2023, 11:44 PM.
Tags
None
Referenced Files
F3341262: D9274.diff
Thu, Nov 21, 10:47 PM
Unknown Object (File)
Mon, Nov 11, 6:19 PM
Unknown Object (File)
Mon, Oct 28, 9:40 PM
Unknown Object (File)
Sat, Oct 26, 1:12 AM
Unknown Object (File)
Oct 20 2024, 3:41 PM
Unknown Object (File)
Oct 20 2024, 3:41 PM
Unknown Object (File)
Oct 20 2024, 3:41 PM
Unknown Object (File)
Oct 20 2024, 3:41 PM
Subscribers

Details

Summary

This diff replaces the hardcoded snap point I set earlier with a snap point that is based off the height of the bottomsheet container. With this new dynamic snap point, the bottom sheet will always update and change it's snap point whenever the height of the container changes (for example when we add or remove a button on the user profile component)

Depends on D9273

Test Plan

Please see the demo videos below

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

native/user-profile/user-profile-relationship-button.react.js
55 ↗(On Diff #31383)

Since we want to measure the height of the user profile bottom sheet before the elements/components get painted on the screen, we should use a useLayoutEffect here

https://chat.openai.com/c/81792e1b-b517-47e3-9b0c-1eda21d8a8f9

https://react.dev/reference/react/useLayoutEffect#measuring-layout-before-the-browser-repaints-the-screen

atul added inline comments.
native/user-profile/user-profile.react.js
52 ↗(On Diff #31383)

Eh we can just use insets.bottom directly within the useLayoutEffect right?

This revision is now accepted and ready to land.Sep 26 2023, 2:06 PM