61 lines
2.9 KiB
TypeScript
61 lines
2.9 KiB
TypeScript
// Metro module 14215 (f14216).
|
|
import { memo, useContext } from "react";
|
|
import { StyleSheet } from "react-native";
|
|
import { QuestDockMode } from "../../QuestConstants";
|
|
import { QUEST_DOCK_EXPANDED_HEIGHT, QUEST_DOCK_MODE_CHANGE_PHYSICS } from "./QuestDockConstants";
|
|
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
|
|
import QuestDockContext from "./QuestDockContext";
|
|
import { QuestDockGestureContext } from "./QuestDockGestureContext";
|
|
import { useAnimatedStyle } from "../../../reanimated/ReanimatedRexport";
|
|
import * as _spring from "../../../../design/animation/reanimated/spring/spring";
|
|
import ReanimatedNativeView from "../../../core/native/ReanimatedNativeView";
|
|
import QuestDockUnenrolledBody from "./QuestDockUnenrolledBody";
|
|
import QuestDockEnrolledBody from "./QuestDockEnrolledBody";
|
|
const useStyles = createStyles({
|
|
wrapper: {
|
|
...StyleSheet.absoluteFillObject,
|
|
bottom: void 0,
|
|
display: "flex",
|
|
zIndex: 1
|
|
}
|
|
});
|
|
const __initData = {
|
|
code: "function QuestDockContentExpandedTsx1(){const{isEnrolled,QUEST_DOCK_EXPANDED_HEIGHT,windowDimensions,withSpring,activeQuestDockMode,QuestDockMode,QUEST_DOCK_MODE_CHANGE_PHYSICS,questDockWrapperSpecs}=this.__closure;return{height:isEnrolled?undefined:QUEST_DOCK_EXPANDED_HEIGHT,width:windowDimensions.get().width,opacity:withSpring(activeQuestDockMode.get()===QuestDockMode.EXPANDED?1:0,QUEST_DOCK_MODE_CHANGE_PHYSICS),transform:[{translateX:withSpring((questDockWrapperSpecs.get().width-windowDimensions.get().width)/2,QUEST_DOCK_MODE_CHANGE_PHYSICS)}]};}"
|
|
};
|
|
const r44 = memo(function QuestDockContentExpanded() {
|
|
const quest = useContext(QuestDockContext).quest;
|
|
const styles = useStyles();
|
|
const context = useContext(QuestDockGestureContext);
|
|
const { activeQuestDockMode, questDockWrapperSpecs, windowDimensions } = context;
|
|
let isEnrolled = quest.userStatus?.enrolledAt != null;
|
|
let c21042_3 = isEnrolled;
|
|
const r33 = () => ({
|
|
height: c21042_3 ? void 0 : QUEST_DOCK_EXPANDED_HEIGHT,
|
|
width: windowDimensions.get().width,
|
|
opacity: _spring.withSpring(activeQuestDockMode.get() === QuestDockMode.EXPANDED ? 1 : 0, QUEST_DOCK_MODE_CHANGE_PHYSICS),
|
|
transform: [{
|
|
translateX: _spring.withSpring((questDockWrapperSpecs.get().width - windowDimensions.get().width) / 2, QUEST_DOCK_MODE_CHANGE_PHYSICS)
|
|
}]
|
|
});
|
|
r33.__closure = {
|
|
isEnrolled,
|
|
QUEST_DOCK_EXPANDED_HEIGHT,
|
|
windowDimensions,
|
|
withSpring: _spring.withSpring,
|
|
activeQuestDockMode,
|
|
QuestDockMode,
|
|
QUEST_DOCK_MODE_CHANGE_PHYSICS,
|
|
questDockWrapperSpecs
|
|
};
|
|
r33.__workletHash = 17161265612101;
|
|
r33.__initData = __initData;
|
|
const animatedStyle = useAnimatedStyle(r33);
|
|
const r52 = [isEnrolled ? !isEnrolled : <QuestDockUnenrolledBody />, ,];
|
|
if (isEnrolled) {
|
|
isEnrolled = <QuestDockEnrolledBody quest={quest} />;
|
|
}
|
|
r52[1] = isEnrolled;
|
|
return <ReanimatedNativeView style={[styles.wrapper, animatedStyle]}>{r52}</ReanimatedNativeView>;
|
|
});
|
|
export default r44;
|