104 lines
5.1 KiB
TypeScript
104 lines
5.1 KiB
TypeScript
// Metro module 15786 (f15787).
|
|
import { View, StyleSheet } from "react-native";
|
|
import { LAUNCH_PAD_SPRING_CONFIG, LaunchPadTypes } from "./LaunchPadConstants";
|
|
import { createStyles } from "../../../design/components/Styles/native/createStyles";
|
|
import useLaunchPadType from "./useLaunchPadType";
|
|
import useLaunchPadState_native from "./useLaunchPadState.native";
|
|
import useLaunchPadGesture from "./useLaunchPadGesture";
|
|
import useWindowDimensionsSharedValue_native from "../../screen/useWindowDimensionsSharedValue.native";
|
|
import * as _ReanimatedRexport from "../../reanimated/ReanimatedRexport";
|
|
import ReanimatedRexport, { useAnimatedReaction, useAnimatedStyle } from "../../reanimated/ReanimatedRexport";
|
|
import * as _spring from "../../../design/animation/reanimated/spring/spring";
|
|
import { MobileHomeDrawerExperiment } from "../../home_drawer/native/HomeDrawerExperiment";
|
|
import LaunchPadGestureRefContext from "./LaunchPadGestureRefContext";
|
|
import { GestureDetector } from "../../../_bundle/Module5273";
|
|
import LaunchPadWrapper from "./LaunchPadWrapper";
|
|
const useStyles = createStyles({
|
|
wrapper: {
|
|
...StyleSheet.absoluteFillObject,
|
|
backgroundColor: "transparent"
|
|
},
|
|
container: {
|
|
...StyleSheet.absoluteFillObject,
|
|
overflow: "hidden"
|
|
}
|
|
});
|
|
const __initData = {
|
|
code: "function LaunchPadContainerTsx1(){const{windowDimensions}=this.__closure;return windowDimensions.get().height;}"
|
|
};
|
|
const __initData2 = {
|
|
code: "function LaunchPadContainerTsx2(height,lastHeight){const{updaters}=this.__closure;if(lastHeight==null)return;if(lastHeight<=height)return;updaters.onWindowHeightChange();}"
|
|
};
|
|
const __initData3 = {
|
|
code: "function LaunchPadContainerTsx3(){const{interpolate,launchPadSharedState,withSpring,windowDimensions,LAUNCH_PAD_SPRING_CONFIG}=this.__closure;return{borderRadius:interpolate(launchPadSharedState.get(),[0,1],[0,16]),transform:[{scale:withSpring(interpolate(launchPadSharedState.get(),[0,1],[1,(windowDimensions.get().width-16*3)/windowDimensions.get().width]),LAUNCH_PAD_SPRING_CONFIG,'animate-always')},{translateY:withSpring(interpolate(launchPadSharedState.get(),[0,1],[0,-4]),LAUNCH_PAD_SPRING_CONFIG,'animate-always')}]};}"
|
|
};
|
|
export default function LaunchPadContainer(props) {
|
|
const children = props.children;
|
|
const styles = useStyles();
|
|
const launchPadType = useLaunchPadType();
|
|
const launchPadState_native = useLaunchPadState_native();
|
|
const { launchPadSharedState, launchPadPullTabState, launchPadShown, gestureState, updaters } = launchPadState_native;
|
|
const launchPadGesture = useLaunchPadGesture({
|
|
launchPadType,
|
|
launchPadSharedState,
|
|
launchPadPullTabState,
|
|
launchPadShown,
|
|
gestureState,
|
|
updaters
|
|
});
|
|
const { gesture, gestureRef } = launchPadGesture;
|
|
const windowDimensionsSharedValue_native = useWindowDimensionsSharedValue_native();
|
|
let c22441_2 = windowDimensionsSharedValue_native;
|
|
const r38 = () => c22441_2.get().height;
|
|
r38.__closure = {
|
|
windowDimensions: windowDimensionsSharedValue_native
|
|
};
|
|
r38.__workletHash = 9985296176902;
|
|
r38.__initData = __initData;
|
|
const l = function l(a0, a1) {
|
|
if (a1 != null && !(a1 <= a0)) {
|
|
updaters.onWindowHeightChange();
|
|
}
|
|
};
|
|
l.__closure = {
|
|
updaters
|
|
};
|
|
l.__workletHash = 418963589215;
|
|
l.__initData = __initData2;
|
|
useAnimatedReaction(r38, l);
|
|
const v = () => {
|
|
const r2 = {
|
|
borderRadius: _ReanimatedRexport.interpolate(launchPadSharedState.get(), [0, 1], [0, 16]),
|
|
transform: null
|
|
};
|
|
const r23 = launchPadSharedState.get();
|
|
r2.transform = [{
|
|
scale: _spring.withSpring(_ReanimatedRexport.interpolate(r23, [0, 1], [1, (c22441_2.get().width - 48) / c22441_2.get().width]), LAUNCH_PAD_SPRING_CONFIG, "animate-always")
|
|
}, {
|
|
translateY: _spring.withSpring(_ReanimatedRexport.interpolate(launchPadSharedState.get(), [0, 1], [0, -4]), LAUNCH_PAD_SPRING_CONFIG, "animate-always")
|
|
}];
|
|
return r2;
|
|
};
|
|
v.__closure = {
|
|
interpolate: _ReanimatedRexport.interpolate,
|
|
launchPadSharedState,
|
|
withSpring: _spring.withSpring,
|
|
windowDimensions: windowDimensionsSharedValue_native,
|
|
LAUNCH_PAD_SPRING_CONFIG
|
|
};
|
|
v.__workletHash = 13886247172712;
|
|
v.__initData = __initData3;
|
|
const animatedStyle = useAnimatedStyle(v);
|
|
const enableHome = MobileHomeDrawerExperiment.useConfig({
|
|
location: "guilds"
|
|
}).enableHome;
|
|
return <LaunchPadGestureRefContext.Provider value={gestureRef}>
|
|
<GestureDetector gesture={gesture}>
|
|
<View style={styles.wrapper}>
|
|
<ReanimatedRexport.View style={[styles.container, animatedStyle]}>{children}</ReanimatedRexport.View>
|
|
{launchPadType === LaunchPadTypes.DISABLED ? enableHome ? <LaunchPadWrapper launchPadType={launchPadType} gestureState={gestureState} launchPadShown={launchPadShown} launchPadSharedState={launchPadSharedState} launchPadPullTabState={launchPadPullTabState} updaters={updaters} /> : void 0 : <LaunchPadWrapper launchPadType={launchPadType} gestureState={gestureState} launchPadShown={launchPadShown} launchPadSharedState={launchPadSharedState} launchPadPullTabState={launchPadPullTabState} updaters={updaters} />}
|
|
</View>
|
|
</GestureDetector>
|
|
</LaunchPadGestureRefContext.Provider>;
|
|
};
|