decord/source/modules/game_claim/native/GameClaimCoachmark.tsx

170 lines
6.5 KiB
TypeScript
Raw Normal View History

2026-07-30 10:14:41 +00:00
// Module ID: 15154
// Function ID: 15155
2026-07-20 16:05:17 +00:00
// Name: PX_8
2026-07-30 10:14:41 +00:00
// Dependencies: [5, 19, 17, 676, 1369, 21, 712, 15155, 9908, 4604, 4189, 15156, 12057, 1236, 5222, 4717, 5175, 4185, 4600, 7619, 11810, 2]
2026-07-20 16:05:17 +00:00
// Exports: getScaledGameClaimNoticeHeight
2026-07-30 10:14:41 +00:00
// Module 15154 (PX_8)
2026-07-23 10:11:24 +00:00
import closure_3 from "jsxProd";
2026-07-29 08:29:29 +00:00
import { View } from "Text";
2026-07-23 10:11:24 +00:00
import ME from "ME";
import { ContentDismissActionType } from "ContentDismissActionType";
2026-07-29 08:29:29 +00:00
import jsxProd from "set";
import createCacheKey from "createCacheKey";
import importAllResult from "LinkExternalSmallIcon";
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
let c5;
let c9;
2026-07-23 10:11:24 +00:00
let closure_6;
2026-07-29 08:29:29 +00:00
let metroImportAll;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
({ GuildFeatures: c5, RelativeMarketingURLs: closure_6 } = ME);
({ jsx: metroImportAll, jsxs: c9 } = jsxProd);
const PX_8 = require("Themes").space.PX_8;
const PX_82 = require("Themes").space.PX_8;
let closure_12 = 2 * require("Themes").space.PX_12;
let obj = { card: null, closeButton: null, centeredText: null, body: null, cta: null };
obj = { padding: require("Themes").space.PX_12 };
obj[0] = obj;
createCacheKey = { position: "absolute", top: require("Themes").space.PX_12, right: require("Themes").space.PX_12, width: 24, height: 24, alignItems: "center", justifyContent: "center", zIndex: 1 };
obj[1] = createCacheKey;
obj[2] = { textAlign: "center" };
obj[3] = { marginTop: require("Themes").space.PX_4 };
let obj2 = { marginTop: require("Themes").space.PX_4 };
obj[4] = { marginTop: require("Themes").space.PX_8 };
let closure_13 = createCacheKey.createStyles(obj);
let obj3 = { marginTop: require("Themes").space.PX_8 };
2026-07-20 16:05:17 +00:00
const memoResult = importAllResult.memo((arg0) => {
let guild;
2026-07-23 10:11:24 +00:00
let require;
({ guild, markAsDismissed: require } = arg0);
2026-07-29 08:29:29 +00:00
const tmp = callback4();
2026-07-30 10:14:41 +00:00
let obj = require(15156) /* fetchUnclaimedGames */;
2026-07-29 08:29:29 +00:00
let first = obj.useUnclaimedGameIdsForGuild(guild.id)[0];
if (first == null) {
first = null;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const intl = tmp2(1236).intl;
const tmp5 = importDefault;
2026-07-30 10:14:41 +00:00
const tmp6 = importDefault(12057);
const coverImageUrl = importDefault(12057)(first, intl.string(require(1236) /* getSystemLocale */.t.VQq92a)).coverImageUrl;
2026-07-20 16:05:17 +00:00
if (null == coverImageUrl) {
return null;
} else {
const features = guild.features;
const hasItem = features.has(constants.VERIFIED);
2026-07-29 08:29:29 +00:00
const intl4 = tmp2(1236).intl;
2026-07-20 16:05:17 +00:00
const string = intl4.string;
2026-07-29 08:29:29 +00:00
const t = tmp2(1236).t;
2026-07-20 16:05:17 +00:00
if (hasItem) {
let stringResult = string(t.uUARXe);
} else {
2026-07-23 10:11:24 +00:00
stringResult = string(t["0Dx29f"]);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj = { variant: "secondary", style: null, children: null };
obj[1] = tmp.card;
obj = { accessibilityRole: "button", onPress: null, style: null, children: null };
obj[1] = function onPress() {
return callback(outer1_7.USER_DISMISS);
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
obj[2] = tmp.closeButton;
obj[3] = callback2(tmp2(5175).XSmallIcon, { size: "sm", color: "text-default" });
const items = [callback2(tmp2(4717).PressableOpacity, obj), , , , ];
let obj1 = { imageSrc: null };
obj1[0] = coverImageUrl;
2026-07-30 10:14:41 +00:00
items[1] = callback2(tmp5(15155), obj1);
2026-07-29 08:29:29 +00:00
const obj2 = { variant: "text-md/medium", color: "text-overlay-light", style: null, children: null };
obj2[2] = tmp.centeredText;
const intl2 = tmp2(1236).intl;
const obj3 = { gameName: null };
obj3[0] = tmp8;
obj2[3] = intl2.format(tmp2(1236).t.Q11WTQ, obj3);
items[2] = callback2(tmp2(4185).Text, obj2);
const obj4 = { variant: "text-sm/normal", color: "text-overlay-light", style: null, children: null };
2026-07-20 16:05:17 +00:00
const items1 = [, ];
2026-07-29 08:29:29 +00:00
({ body: arr2[0], centeredText: arr2[1] } = tmp);
obj4[2] = items1;
obj4[3] = stringResult;
items[3] = callback2(tmp2(4185).Text, obj4);
const obj5 = { style: null, children: null };
obj5[0] = tmp.cta;
const obj6 = { variant: "primary", size: "sm", text: null, icon: null, iconPosition: "end", onPress: null };
const intl3 = tmp2(1236).intl;
obj6[2] = intl3.string(tmp2(1236).t["2u6ZlY"]);
2026-07-30 10:14:41 +00:00
obj6[3] = callback2(tmp2(7619).LinkExternalSmallIcon, { size: "xs", color: "white" });
2026-07-29 08:29:29 +00:00
obj6[5] = callback(function*() {
if (v0 === 2) {
v0 = 3;
HermesBuiltin.throwTypeError();
} else if (tmp3 === 3) {
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
return { value: "HermesInternal", done: null };
}
} else {
try {
v0 = 2;
if (0 === v02) {
if (arg0 === 1) {
v0 = 3;
throw arg1;
} else if (arg0 === 2) {
v0 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
v0(outer1_7.TAKE_ACTION);
let obj1 = v02(outer1_2[20]);
v02 = 1;
v0 = 1;
obj1 = { value: null, done: false };
obj1[0] = obj1.redirectDeveloperPortalWithHandoffToken(outer1_6.DEVELOPER_PORTAL_APPLICATIONS_GAME_IDENTITY);
return obj1;
}
} else if (arg0 === 1) {
v0 = 3;
throw arg1;
} else if (arg0 === 2) {
v0 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
v0 = 3;
return { value: "HermesInternal", done: null };
}
} catch (tmp11) {
v0 = tmp;
throw tmp11;
}
}
});
obj5[1] = callback2(tmp2(4600).Button, obj6);
2026-07-20 16:05:17 +00:00
items[4] = callback2(View, obj5);
2026-07-29 08:29:29 +00:00
obj[2] = items;
return callback3(tmp2(5222).Card, obj);
2026-07-20 16:05:17 +00:00
}
2026-07-30 10:14:41 +00:00
const tmp6Result = importDefault(12057)(first, intl.string(require(1236) /* getSystemLocale */.t.VQq92a));
2026-07-20 16:05:17 +00:00
});
2026-07-23 10:11:24 +00:00
let result = require("get ActivityIndicator").fileFinishedImporting("modules/game_claim/native/GameClaimCoachmark.tsx");
2026-07-20 16:05:17 +00:00
export default memoResult;
export const GAME_CLAIM_NOTICE_MARGIN_TOP = PX_8;
export const GAME_CLAIM_NOTICE_MARGIN_BOTTOM = PX_82;
export const getScaledGameClaimNoticeHeight = function getScaledGameClaimNoticeHeight(fontScale) {
const sum = PX_8 + closure_12;
2026-07-30 10:14:41 +00:00
const sum1 = sum + require(15155) /* importDefaultResult1 */.CARD_STACK_HEIGHT;
const sum2 = sum1 + require(9908) /* map */.scaleTextLineHeight("text-md/medium", fontScale);
2026-07-29 08:29:29 +00:00
const sum3 = sum2 + importDefault(712).space.PX_4;
2026-07-30 10:14:41 +00:00
const obj = require(9908) /* map */;
const result = 2 * require(9908) /* map */.scaleTextLineHeight("text-sm/normal", fontScale);
2026-07-29 08:29:29 +00:00
const sum4 = sum3 + result + importDefault(712).space.PX_8;
return sum4 + require(4604) /* MINIMUM_HIT_AREA */.SMALL_BUTTON_HEIGHT + PX_82;
2026-07-20 16:05:17 +00:00
};