Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3343754
D9098.id30861.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1013 B
Referenced Files
None
Subscribers
None
D9098.id30861.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D9098: [native] introduce onClosed callback prop to BottomSheet component
Attached
Detach File
Event Timeline
Log In to Comment