49 lines
2.0 KiB
TypeScript
49 lines
2.0 KiB
TypeScript
// Metro module 15793 (f15794).
|
|
import { useEffect } from "react";
|
|
import { NativeEventEmitter, NativeModules } from "react-native";
|
|
import { useSharedValue, useDerivedValue } from "../../reanimated/ReanimatedRexport";
|
|
import { useIsVoicePanelFullscreen } from "../../voice_panel/VoicePanelUtils.native";
|
|
const DCDScrollTracker = NativeModules.DCDScrollTracker;
|
|
let c11289_3 = DCDScrollTracker ? new NativeEventEmitter(DCDScrollTracker) : void 0;
|
|
const __initData = {
|
|
code: "function useLaunchPadPullTabMinimizedTsx1(){const{launchPadPullTabState,isVoicePanelOpen,launchPadSharedState,isMinimizedDuringScroll}=this.__closure;const isMinimized=(launchPadPullTabState.get().minimized||isVoicePanelOpen)&&launchPadSharedState.get()<=0;return isMinimized||isMinimizedDuringScroll.get();}"
|
|
};
|
|
export default function useLaunchPadPullTabMinimized({ launchPadSharedState, launchPadPullTabState }) {
|
|
let sharedValue;
|
|
sharedValue = void 0;
|
|
const isVoicePanelFullscreen = useIsVoicePanelFullscreen();
|
|
const sharedValue2 = useSharedValue(false);
|
|
useEffect(() => {
|
|
let c30920_0 = -1;
|
|
let c30920_1 = c11289_3 == null ? void 0 : c11289_3.addListener("isScrollingOrDragging", ({ isScrollingOrDragging }) => {
|
|
clearTimeout(c30920_0);
|
|
if (isScrollingOrDragging) {
|
|
sharedValue2.set(true);
|
|
} else {
|
|
c30920_0 = setTimeout(() => {
|
|
sharedValue2.set(false);
|
|
}, 1000);
|
|
}
|
|
});
|
|
return () => {
|
|
clearTimeout(c30920_0);
|
|
if (c30920_1 != null) {
|
|
c30920_1.remove();
|
|
}
|
|
};
|
|
}, [sharedValue2]);
|
|
sharedValue = sharedValue2;
|
|
const u = function u() {
|
|
return (launchPadPullTabState.get().minimized || isVoicePanelFullscreen) && launchPadSharedState.get() <= 0 || sharedValue.get();
|
|
};
|
|
u.__closure = {
|
|
launchPadPullTabState,
|
|
isVoicePanelOpen: isVoicePanelFullscreen,
|
|
launchPadSharedState,
|
|
isMinimizedDuringScroll: sharedValue2
|
|
};
|
|
u.__workletHash = 14263056934448;
|
|
u.__initData = __initData;
|
|
return useDerivedValue(u);
|
|
};
|