UNPKG

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

Version:
22 lines (21 loc) 711 B
"use strict"; import { useAnimatedStyle } from "react-native-reanimated"; import { useBottomSheetToolboxInternalContext } from "../context"; export function useAnimatedSheetStyle() { const { currentPositionSharedValue, wrapperHeightSharedValue } = useBottomSheetToolboxInternalContext(); return 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