Page MenuHomePhabricator

[native] introduce custom bottom sheet handle component
ClosedPublic

Authored by ginsu on Aug 25 2023, 1:23 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Sep 7, 4:20 AM
Unknown Object (File)
Sat, Sep 7, 4:20 AM
Unknown Object (File)
Sat, Sep 7, 4:20 AM
Unknown Object (File)
Sat, Sep 7, 4:20 AM
Unknown Object (File)
Sat, Sep 7, 4:20 AM
Unknown Object (File)
Sat, Sep 7, 4:15 AM
Unknown Object (File)
Mon, Aug 26, 4:55 PM
Unknown Object (File)
Mon, Aug 26, 2:13 PM
Subscribers

Details

Summary

Based on our designs we need to implement a custom bottom sheet handle component that can be passed to BottomSheetModal as a prop.

Designs:

Screenshot 2023-08-25 at 2.19.48 PM.png (1×734 px, 134 KB)

Link to the docs: https://gorhom.github.io/react-native-bottom-sheet/props#handlecomponent

Depends on D8955

Test Plan

Please see the before and after screenshots:

Before:

Screenshot 2023-08-25 at 4.21.04 PM.png (1×1 px, 774 KB)

After:

Screenshot 2023-08-25 at 4.26.29 PM.png (1×1 px, 774 KB)

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ginsu edited the test plan for this revision. (Show Details)

update height

ginsu requested review of this revision.Aug 25 2023, 1:49 PM
native/bottom-sheets/bottom-sheet-handle.react.js
16 ↗(On Diff #30335)

We need this second view here in order to prevent the following from happening:

If a user presses down in between the knob and bottomsheet it triggers unwanted actions in the background. Eventually when we place a backdrop with the bottomsheet, this will also help prevent these unwanted background actions; however, it could also lead to unwanted dismissals of the bottomsheet.

Adding this view as a gap (green background) does the following:

It makes sure that even if the user presses down in the gap between the bottom sheet and the knob, the gap is part of the handle so it will only control the bottomsheet

This revision is now accepted and ready to land.Aug 27 2023, 11:51 AM
This revision was landed with ongoing or failed builds.Sep 6 2023, 11:07 AM
This revision was automatically updated to reflect the committed changes.
native/bottom-sheets/bottom-sheet-handle.react.js
37

Would've been great to React.memo this component. It only ever needs to be rendered once (unless color scheme changes)