Files
discord-decomp/_bundle/BottomSheetView.jsx
T
2026-11-01 12:12:55 +02:00

30 lines
1.5 KiB
React

// Metro module 5487 (f5488).
import { useCallback, useEffect, useMemo, memo } from "react";
import { View } from "react-native";
import { useBottomSheetInternal, useBottomSheetContentContainerStyle } from "./Module5250";
import { styles } from "./Module5488";
import { SCROLLABLE_TYPE } from "./Module5246";
const r27 = memo(function BottomSheetViewComponent(props) {
const { focusHook = useEffect, enableFooterMarginAdjustment = false, onLayout, style, children, ...props2 } = props;
const bottomSheetInternal = useBottomSheetInternal();
const { animatedScrollableContentOffsetY, animatedScrollableType, enableDynamicSizing, animatedContentHeight } = bottomSheetInternal;
const bottomSheetContentContainerStyle = useBottomSheetContentContainerStyle(enableFooterMarginAdjustment, style);
const memo = useMemo(() => [bottomSheetContentContainerStyle, styles.container], [bottomSheetContentContainerStyle]);
const callback = useCallback(() => {
animatedScrollableContentOffsetY.value = 0;
animatedScrollableType.value = SCROLLABLE_TYPE.VIEW;
}, [animatedScrollableContentOffsetY, animatedScrollableType]);
const callback2 = useCallback((a0) => {
if (enableDynamicSizing) {
animatedContentHeight.set(a0.nativeEvent.layout.height);
}
if (onLayout) {
onLayout(a0);
}
}, [onLayout, animatedContentHeight, enableDynamicSizing]);
focusHook(callback);
return <View {...props2} onLayout={callback2} style={memo}>{children}</View>;
});
r27.displayName = "BottomSheetView";
export default r27;