Page MenuHomePhabricator

D9098.id30861.diff
No OneTemporary

D9098.id30861.diff

diff --git a/native/bottom-sheets/bottom-sheet.react.js b/native/bottom-sheets/bottom-sheet.react.js
--- a/native/bottom-sheets/bottom-sheet.react.js
+++ b/native/bottom-sheets/bottom-sheet.react.js
@@ -9,18 +9,28 @@
type Props = {
+children: React.Node,
+ +onClosed: () => mixed,
};
function ForwardedBottomSheet(
props: Props,
ref: React.Ref<typeof BottomSheetModal>,
): React.Node {
- const { children } = props;
+ const { children, onClosed } = props;
const styles = useStyles(unboundStyles);
const snapPoints = React.useMemo(() => ['25%', '50%'], []);
+ const onChange = React.useCallback(
+ (index: number) => {
+ if (index === -1) {
+ onClosed();
+ }
+ },
+ [onClosed],
+ );
+
return (
<BottomSheetModal
ref={ref}
@@ -28,6 +38,7 @@
snapPoints={snapPoints}
handleComponent={BottomSheetHandle}
backdropComponent={BottomSheetBackdrop}
+ onChange={onChange}
>
{children}
</BottomSheetModal>

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 23, 4:00 AM (17 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2568040
Default Alt Text
D9098.id30861.diff (1013 B)

Event Timeline