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, Dec 15, 1:42 AM
Unknown Object (File)
Thu, Dec 12, 2:34 AM
Unknown Object (File)
Thu, Dec 5, 5:28 AM
Unknown Object (File)
Wed, Dec 4, 10:10 PM
Unknown Object (File)
Mon, Nov 25, 9:07 AM
Unknown Object (File)
Fri, Nov 22, 5:00 AM
Unknown Object (File)
Nov 22 2024, 4:14 AM
Unknown Object (File)
Nov 22 2024, 4:07 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