Page MenuHomePhabricator

[native] make bottomsheet snap point dynamic
ClosedPublic

Authored by ginsu on Sep 24 2023, 11:44 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Oct 13, 8:40 AM
Unknown Object (File)
Sun, Oct 13, 7:58 AM
Unknown Object (File)
Mon, Oct 7, 5:36 PM
Unknown Object (File)
Sep 13 2024, 2:57 AM
Unknown Object (File)
Sep 13 2024, 2:57 AM
Unknown Object (File)
Sep 13 2024, 2:57 AM
Unknown Object (File)
Sep 13 2024, 2:57 AM
Unknown Object (File)
Sep 13 2024, 2:56 AM
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