decord/source/modules/quests/native/QuestRewardTile.tsx

105 lines
3.9 KiB
TypeScript
Raw Normal View History

2026-07-23 10:11:24 +00:00
// Module ID: 10922
// Function ID: 84860
2026-07-20 16:05:17 +00:00
// Name: QuestRewardTile
2026-07-23 10:11:24 +00:00
// Dependencies: [57, 31, 27, 4122, 33, 4130, 689, 477, 566, 9463, 9458, 8302, 5085, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-07-23 10:11:24 +00:00
// Module 10922 (QuestRewardTile)
import _slicedToArray from "_slicedToArray";
import result from "result";
import { useMemo } from "result";
import get_ActivityIndicator from "get ActivityIndicator";
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
import { jsx } from "jsxProd";
import _createForOfIteratorHelperLoose from "_createForOfIteratorHelperLoose";
let closure_6;
let closure_7;
const require = arg1;
({ AppState: closure_6, View: closure_7 } = get_ActivityIndicator);
let closure_10 = _createForOfIteratorHelperLoose.createStyles(() => {
2026-07-20 16:05:17 +00:00
let obj = {};
2026-07-23 10:11:24 +00:00
obj = { borderRadius: importDefault(689).radii.sm, display: "flex", justifyContent: "center", alignItems: "center", overflow: "hidden" };
2026-07-20 16:05:17 +00:00
obj.container = obj;
2026-07-23 10:11:24 +00:00
obj.video = { overflow: "hidden", height: "100%", width: "100%" };
obj.image = { height: "100%", width: "100%" };
2026-07-20 16:05:17 +00:00
return obj;
});
2026-07-23 10:11:24 +00:00
const result = require("get ActivityIndicator").fileFinishedImporting("modules/quests/native/QuestRewardTile.tsx");
2026-07-20 16:05:17 +00:00
export default function QuestRewardTile(quest) {
quest = quest.quest;
const height = quest.height;
const width = quest.width;
let flag = quest.paused;
if (flag === undefined) {
flag = false;
}
let withAnimation = quest.withAnimation;
if (withAnimation === undefined) {
2026-07-23 10:11:24 +00:00
let obj = quest(width[7]);
2026-07-20 16:05:17 +00:00
withAnimation = obj.isIOS();
}
let callback;
let React;
2026-07-23 10:11:24 +00:00
let obj1 = quest(width[8]);
const items = [_isNativeReflectConstruct];
2026-07-20 16:05:17 +00:00
const items1 = [quest];
2026-07-23 10:11:24 +00:00
const stateFromStores = obj1.useStateFromStores(items, () => outer1_8.useReducedMotion);
2026-07-20 16:05:17 +00:00
const tmp4 = useMemo(() => quest(width[9]).getQuestPrimaryReward(quest), items1);
if (null != tmp4.name) {
let name = tmp4.name;
} else {
name = tmp4.messages.name;
}
const items2 = [quest];
const tmp5 = useMemo(() => quest(width[10]).getQuestAsset(quest, quest(width[10]).QuestAssetType.REWARD, undefined, true), items2);
callback = tmp5;
const tmp6 = callback2();
const tmp7 = callback(React.useState("active" === currentState.currentState), 2);
React = tmp7[1];
const items3 = [tmp5.isAnimated];
const effect = React.useEffect(() => {
2026-07-23 10:11:24 +00:00
if (_undefined.isAnimated) {
let closure_0 = outer1_6.addEventListener("change", (arg0) => {
outer1_4("active" === arg0);
2026-07-20 16:05:17 +00:00
});
return () => {
closure_0.remove();
};
}
}, items3);
const items4 = [tmp5, width, height];
const memo = React.useMemo(() => {
let obj = quest(width[10]);
2026-07-23 10:11:24 +00:00
obj = { assetUrl: _undefined.url, width, height };
2026-07-20 16:05:17 +00:00
return obj.getScaledImageUrl(obj);
}, items4);
const items5 = [quest.accessibilityLabelPrefix, name];
const found = items5.filter(Boolean);
obj = { accessibilityLabel: found.join(", "), style: items6 };
2026-07-23 10:11:24 +00:00
items6 = [tmp6.container, { height, width }, quest.style];
2026-07-20 16:05:17 +00:00
if (tmp5.isAnimated) {
if (withAnimation) {
2026-07-23 10:11:24 +00:00
obj = { style: tmp6.video, source: null, disableFocus: true, preventsDisplaySleepDuringVideoPlayback: false, importantForAccessibility: "no-hide-descendants", poster: null, resizeMode: "cover" };
2026-07-20 16:05:17 +00:00
obj1 = { uri: tmp5.url };
obj.source = obj1;
obj.poster = memo;
let tmp16 = !tmp7[0];
if (!tmp16) {
tmp16 = flag;
}
if (!tmp16) {
tmp16 = stateFromStores;
}
obj.paused = tmp16;
obj.muted = true;
2026-07-23 10:11:24 +00:00
let tmp13Result = jsx(quest(width[11]).VideoComponent, { style: tmp6.video, source: null, disableFocus: true, preventsDisplaySleepDuringVideoPlayback: false, importantForAccessibility: "no-hide-descendants", poster: null, resizeMode: "cover" });
2026-07-20 16:05:17 +00:00
const tmp13 = jsx;
}
obj.children = tmp13Result;
return tmp10(tmp11, obj);
}
2026-07-23 10:11:24 +00:00
tmp13Result = jsx(height(width[12]), { source: { uri: memo }, style: tmp6.image });
2026-07-20 16:05:17 +00:00
};