22 lines
860 B
TypeScript
22 lines
860 B
TypeScript
// Metro module 8132 (f8133).
|
|
import { useContext, useEffect, useCallback } from "react";
|
|
import { MEDIA_MODAL_KEY } from "../../../../Constants";
|
|
import ActionSheetContext from "../../../action_sheet/native/ActionSheetContext";
|
|
import ActionSheetActionCreators from "../../../action_sheet/native/ActionSheetActionCreators";
|
|
import MediaModal from "./MediaModal";
|
|
export default function MediaModalSheetWrapper(props) {
|
|
const { onCloseCallback, ...props2 } = props;
|
|
const context = useContext(ActionSheetContext);
|
|
useEffect(() => {
|
|
if (context?.transitionState === "exiting") {
|
|
context.onLeave();
|
|
}
|
|
}, [context]);
|
|
return <MediaModal {...props2} onClose={useCallback(() => {
|
|
if (onCloseCallback != null) {
|
|
onCloseCallback();
|
|
}
|
|
ActionSheetActionCreators.hideActionSheet(MEDIA_MODAL_KEY);
|
|
}, [onCloseCallback])} />;
|
|
};
|