UNPKG

@attio/react-native-bottom-sheet-toolbox

Version:
31 lines (30 loc) 965 B
"use strict"; import * as React from "react"; import { StyleSheet, View } from "react-native"; import { useBottomSheetToolboxInternalContext } from "../context"; import { jsx as _jsx } from "react/jsx-runtime"; export function BottomSheetToolboxWrapper({ insetTop, children }) { const { wrapperHeightSharedValue } = useBottomSheetToolboxInternalContext(); const unmountFn = () => { wrapperHeightSharedValue.set(null); }; const onUnmountRef = React.useRef(unmountFn); onUnmountRef.current = unmountFn; React.useLayoutEffect(() => () => onUnmountRef.current(), []); return /*#__PURE__*/_jsx(View, { style: [StyleSheet.absoluteFillObject, { marginTop: insetTop }], onLayout: evt => { wrapperHeightSharedValue.set(evt.nativeEvent.layout.height === 0 ? null : evt.nativeEvent.layout.height); }, pointerEvents: "box-none", children: children }); } //# sourceMappingURL=bottom-sheet-toolbox-wrapper.js.map