Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33020076
D9098.1768385583.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1013 B
Referenced Files
None
Subscribers
None
D9098.1768385583.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
Wed, Jan 14, 10:13 AM (38 m, 37 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5931422
Default Alt Text
D9098.1768385583.diff (1013 B)
Attached To
Mode
D9098: [native] introduce onClosed callback prop to BottomSheet component
Attached
Detach File
Event Timeline
Log In to Comment