213 lines
9.8 KiB
TypeScript
213 lines
9.8 KiB
TypeScript
// Module ID: 14284
|
|
// Function ID: 14285
|
|
// Name: BountiesScrollEndCardContent
|
|
// Dependencies: [19, 17, 4295, 5161, 21, 4303, 712, 4304, 4307, 10981, 14282, 1236, 4036, 4725, 14285, 14287, 4299, 9861, 14251, 589, 14252, 8659, 2]
|
|
// Exports: default
|
|
|
|
// Module 14284 (BountiesScrollEndCardContent)
|
|
import initialize from "initialize";
|
|
import get_ActivityIndicator from "RetryIcon";
|
|
import maybeApplyNoTextColorForLightCustomTheme from "maybeApplyNoTextColorForLightCustomTheme";
|
|
import { QuestsExperimentLocations } from "QuestsExperimentLocations";
|
|
import jsxProd from "AnimatedRenderItem";
|
|
import createCacheKey from "createCacheKey";
|
|
|
|
let c10;
|
|
let c4;
|
|
let c5;
|
|
let c9;
|
|
let closure_6;
|
|
const require = arg1;
|
|
function BountiesScrollEndCardContent(isScrollingInBoundsSharedValue) {
|
|
let bounty;
|
|
let isActive;
|
|
let onReplay;
|
|
let opacityStyle;
|
|
let visible;
|
|
({ bounty, isActive } = isScrollingInBoundsSharedValue);
|
|
isScrollingInBoundsSharedValue = isScrollingInBoundsSharedValue.isScrollingInBoundsSharedValue;
|
|
const sourceQuestContent = isScrollingInBoundsSharedValue.sourceQuestContent;
|
|
({ visible, onReplay, opacityStyle } = isScrollingInBoundsSharedValue);
|
|
const tmp = callback2();
|
|
let obj = isActive(10981);
|
|
const isBountiesVerticalScrollExperimentEnabled = obj.useIsBountiesVerticalScrollExperimentEnabled("BountiesScrollEndCard");
|
|
let obj1 = isActive(14282);
|
|
const bountyCtaInfo = obj1.getBountyCtaInfo(bounty);
|
|
const intl = isActive(1236).intl;
|
|
const stringResult = intl.string(isActive(1236).t["9UtZAY"]);
|
|
let obj2 = isActive(4036);
|
|
const fn = function y() {
|
|
let obj = isScrollingInBoundsSharedValue;
|
|
if (isScrollingInBoundsSharedValue != null) {
|
|
const value = obj.get();
|
|
}
|
|
let num = 0;
|
|
if (isActive) {
|
|
num = 0;
|
|
if (true !== value) {
|
|
num = 1;
|
|
}
|
|
}
|
|
obj = { opacity: isActive(outer1_2[7]).withTiming(num, isActive(outer1_2[8]).timingStandard) };
|
|
return obj;
|
|
};
|
|
obj = { isScrollingInBoundsSharedValue, withTiming: isActive(4304).withTiming, isActive, timingStandard: isActive(4307).timingStandard };
|
|
fn.__closure = obj;
|
|
fn.__workletHash = 4903386092677;
|
|
fn.__initData = closure_14;
|
|
const animatedStyle = obj2.useAnimatedStyle(fn);
|
|
obj = { style: items, pointerEvents: "box-none", children: null };
|
|
items = [tmp.container, opacityStyle];
|
|
obj1 = { style: tmp.backdropTint, pointerEvents: "none" };
|
|
const items1 = [callback(closure_6, obj1), , ];
|
|
obj2 = { colors: ["rgba(0, 0, 0, 0.48)", "rgba(0, 0, 0, 0.8)"], style: tmp.backdropGradient, pointerEvents: "none" };
|
|
items1[1] = callback(isScrollingInBoundsSharedValue(4725), obj2);
|
|
if (isBountiesVerticalScrollExperimentEnabled) {
|
|
const obj3 = { style: null, pointerEvents: "box-none", children: null };
|
|
const items2 = [tmp.overlayContent, animatedStyle];
|
|
obj3[0] = items2;
|
|
const obj4 = { bounty: null, sourceQuestContent: null, disabled: null };
|
|
obj4[0] = bounty;
|
|
obj4[1] = sourceQuestContent;
|
|
obj4[2] = !isActive;
|
|
const items3 = [tmp10(tmp9(14285), obj4), ];
|
|
const obj5 = { style: null, pointerEvents: "box-none", children: null };
|
|
obj5[0] = tmp.endedCtaButtonsContainer;
|
|
const obj6 = { bounty: null, visible: null, sourceQuestContent: null, onClose: null, showCloseButton: false, disabled: null };
|
|
obj6[0] = bounty;
|
|
obj6[1] = visible;
|
|
obj6[2] = sourceQuestContent;
|
|
obj6[3] = function onClose() {
|
|
|
|
};
|
|
obj6[5] = !isActive;
|
|
obj5[2] = tmp10(tmp9(14287), obj6);
|
|
items3[1] = tmp10(tmp11, obj5);
|
|
obj3[2] = items3;
|
|
let tmp10Result = tmp8(tmp9(4036).View, obj3);
|
|
} else {
|
|
let tmp13;
|
|
if (isActive) {
|
|
tmp13 = onReplay;
|
|
}
|
|
const obj7 = { onPress: null, disabled: null, accessibilityRole: "button", accessibilityLabel: null, style: null, children: null };
|
|
obj7[0] = tmp13;
|
|
obj7[1] = !isActive;
|
|
obj7[3] = stringResult;
|
|
obj7[4] = tmp.pressable;
|
|
const obj8 = { style: null, children: null };
|
|
const items4 = [tmp.overlayContent, animatedStyle];
|
|
obj8[0] = items4;
|
|
const obj9 = { style: null, children: null };
|
|
obj9[0] = tmp.textBlock;
|
|
const obj10 = { variant: "heading-md/semibold", color: "text-strong", children: null };
|
|
obj10[2] = bountyCtaInfo.label;
|
|
const items5 = [tmp10(tmp2(4299).Text, obj10), ];
|
|
const obj11 = { variant: "heading-sm/medium", color: "text-default", children: null };
|
|
obj11[2] = stringResult;
|
|
items5[1] = tmp10(tmp2(4299).Text, obj11);
|
|
obj9[1] = items5;
|
|
const items6 = [tmp8(tmp11, obj9), ];
|
|
const obj12 = { accessible: false, color: null, style: null };
|
|
obj12[1] = tmp9(712).colors.CONTROL_OVERLAY_SECONDARY_TEXT_DEFAULT;
|
|
obj12[2] = tmp.replayIcon;
|
|
items6[1] = tmp10(tmp2(9861).RetryIcon, obj12);
|
|
obj8[1] = items6;
|
|
obj7[5] = tmp8(tmp9(4036).View, obj8);
|
|
tmp10Result = tmp10(closure_4, obj7);
|
|
const tmp12 = closure_4;
|
|
}
|
|
items1[2] = tmp10Result;
|
|
obj[2] = items1;
|
|
return closure_10(isScrollingInBoundsSharedValue(4036).View, obj);
|
|
}
|
|
({ Pressable: c4, StyleSheet: c5, View: closure_6 } = get_ActivityIndicator);
|
|
({ jsx: c9, jsxs: c10 } = jsxProd);
|
|
let closure_11 = createCacheKey.createStyles(() => {
|
|
let obj = { container: null, backdropTint: null, backdropGradient: null, overlayContent: null, pressable: null, textBlock: null, replayIcon: null, endedCtaButtonsContainer: null };
|
|
obj = {};
|
|
const merged = Object.assign(closure_5.absoluteFillObject);
|
|
obj[0] = obj;
|
|
obj = {};
|
|
const merged1 = Object.assign(closure_5.absoluteFillObject);
|
|
obj.backgroundColor = "rgba(0, 0, 0, 0.6)";
|
|
obj[1] = obj;
|
|
const merged2 = Object.assign(closure_5.absoluteFillObject);
|
|
obj[2] = {};
|
|
const obj2 = {};
|
|
const merged3 = Object.assign(closure_5.absoluteFillObject);
|
|
obj2.justifyContent = "center";
|
|
obj2.alignItems = "center";
|
|
obj[3] = obj2;
|
|
const obj3 = {};
|
|
const merged4 = Object.assign(closure_5.absoluteFillObject);
|
|
obj3.justifyContent = "center";
|
|
obj3.alignItems = "center";
|
|
obj[4] = obj3;
|
|
obj[5] = { alignItems: "center", gap: importDefault(712).space.PX_4 };
|
|
const obj1 = {};
|
|
const obj4 = { alignItems: "center", gap: importDefault(712).space.PX_4 };
|
|
obj[6] = { margin: importDefault(712).space.PX_12 };
|
|
const obj5 = { margin: importDefault(712).space.PX_12 };
|
|
obj[7] = { position: "absolute", left: importDefault(712).space.PX_16, right: importDefault(712).space.PX_16, bottom: importDefault(712).space.PX_16 };
|
|
return obj;
|
|
});
|
|
let fn = function t(value) {
|
|
const obj = { opacity: null };
|
|
obj[0] = require(4304) /* CONFIG_NEVER_ANIMATE_TIMING */.withTiming(value, require(4307) /* timingNone */.timingStandard, "respect-motion-settings");
|
|
return obj;
|
|
};
|
|
createCacheKey = { withTiming: require("CONFIG_NEVER_ANIMATE_TIMING").withTiming, timingStandard: require("timingNone").timingStandard };
|
|
fn.__closure = createCacheKey;
|
|
fn.__workletHash = 12127714049951;
|
|
fn.__initData = { code: "function BountiesScrollEndCardTsx1(visible){const{withTiming,timingStandard}=this.__closure;return{opacity:withTiming(visible,timingStandard,'respect-motion-settings')};}" };
|
|
const fn2 = function n(value, fn2) {
|
|
const obj = { opacity: null };
|
|
obj[0] = require(4304) /* CONFIG_NEVER_ANIMATE_TIMING */.withTiming(value, require(4307) /* timingNone */.timingStandard, "respect-motion-settings", fn2);
|
|
return obj;
|
|
};
|
|
createCacheKey = { withTiming: require("CONFIG_NEVER_ANIMATE_TIMING").withTiming, timingStandard: require("timingNone").timingStandard };
|
|
fn2.__closure = createCacheKey;
|
|
fn2.__workletHash = 7470211880124;
|
|
fn2.__initData = { code: "function BountiesScrollEndCardTsx2(visible,cleanUp){const{withTiming,timingStandard}=this.__closure;return{opacity:withTiming(visible,timingStandard,'respect-motion-settings',cleanUp)};}" };
|
|
let closure_14 = { code: "function BountiesScrollEndCardTsx3(){const{isScrollingInBoundsSharedValue,withTiming,isActive,timingStandard}=this.__closure;var _isScrollingInBoundsS;const isScrollingInBounds=((_isScrollingInBoundsS=isScrollingInBoundsSharedValue)===null||_isScrollingInBoundsS===void 0?void 0:_isScrollingInBoundsS.get())===true;return{opacity:withTiming(isActive&&!isScrollingInBounds?1:0,timingStandard)};}" };
|
|
const result = require("maybeApplyNoTextColorForLightCustomTheme").fileFinishedImporting("modules/quests/native/BountiesModal/BountiesScrollEndCard.tsx");
|
|
|
|
export default function BountiesScrollEndCard(visible) {
|
|
visible = visible.visible;
|
|
let obj = require(14251) /* apexExperiment */;
|
|
const isBountiesModalTransitionsRefactorEnabled = obj.useIsBountiesModalTransitionsRefactorEnabled(QuestsExperimentLocations.VIDEO_MODAL_MOBILE);
|
|
let obj1 = require(589) /* initialize */;
|
|
const items = [maybeApplyNoTextColorForLightCustomTheme];
|
|
const stateFromStores = obj1.useStateFromStores(items, () => useReducedMotion.useReducedMotion);
|
|
const callback = React.useCallback((arg0, opacityStyle) => {
|
|
const obj = {};
|
|
const merged = Object.assign(arg0);
|
|
obj.opacityStyle = opacityStyle;
|
|
return callback(closure_15, obj);
|
|
}, []);
|
|
obj = { visible, entranceTiming: require(4307) /* timingNone */.timingStandard, exitTiming: require(4307) /* timingNone */.timingStandard };
|
|
const visibilityTransition = require(14252) /* useVisibilityTransition */.useVisibilityTransition(obj);
|
|
let shouldRender = visibilityTransition.shouldRender;
|
|
if (isBountiesModalTransitionsRefactorEnabled) {
|
|
obj = { useReducedMotion: null, item: null, entering: null, exiting: null, renderItem: null };
|
|
obj[0] = stateFromStores;
|
|
let tmp15;
|
|
if (visible) {
|
|
tmp15 = visible;
|
|
}
|
|
obj[1] = tmp15;
|
|
obj[2] = fn;
|
|
obj[3] = fn2;
|
|
obj[4] = callback;
|
|
shouldRender = callback(importDefault(8659), obj);
|
|
const tmp12 = callback;
|
|
const tmp14 = importDefault(8659);
|
|
} else if (shouldRender) {
|
|
obj1 = {};
|
|
let merged = Object.assign(visible);
|
|
obj1.opacityStyle = tmp6;
|
|
shouldRender = callback(BountiesScrollEndCardContent, obj1);
|
|
}
|
|
return shouldRender;
|
|
};
|