UNPKG

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

Version:
26 lines (25 loc) 842 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.useAnimatedSheetStyle = useAnimatedSheetStyle; var _reactNativeReanimated = require("react-native-reanimated"); var _context = require("../context"); function useAnimatedSheetStyle() { const { currentPositionSharedValue, wrapperHeightSharedValue } = (0, _context.useBottomSheetToolboxInternalContext)(); return (0, _reactNativeReanimated.useAnimatedStyle)(() => { const wrapperHeight = wrapperHeightSharedValue.get(); if (wrapperHeight === null) return {}; const translateY = wrapperHeight - currentPositionSharedValue.get(); return { opacity: 1, transform: [{ translateY }] }; }, [currentPositionSharedValue, wrapperHeightSharedValue]); } //# sourceMappingURL=use-animated-sheet-style.js.map