decord/source/modules/virtual_currency/native/BalanceWidgetMenu.tsx

176 lines
8.1 KiB
TypeScript
Raw Normal View History

// Module ID: 15619
// Function ID: 15620
2026-07-20 16:05:17 +00:00
// Name: BalanceWidget
// Dependencies: [19, 17, 673, 675, 1383, 5404, 21, 5084, 4477, 1233, 10554, 1372, 695, 11699, 5407, 15620, 8780, 4448, 11033, 2008, 7122, 7474, 11032, 4301, 4952, 4481, 709, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
// Module 15619 (BalanceWidget)
2026-09-02 09:53:35 +00:00
import ThemesDefault from "Themes" /* 709 */;
import getSystemLocale from "getSystemLocale" /* 1233 */;
import UNSAFE_isDismissibleContentDismissed from "UNSAFE_isDismissibleContentDismissed" /* 4301 */;
import Text from "Text" /* 4477 */;
import PressableBase from "PressableBase" /* 5084 */;
import _mod8780 from "module_8780" /* 8780 */;
import SelectedDismissibleContentDefault from "SelectedDismissibleContent" /* 10554 */;
import BalanceWidgetPillButtonDefault from "BalanceWidgetPillButton" /* 11032 */;
2026-08-24 06:08:38 +00:00
import closure_3 from "noop" /* 19 */;
import { View } from "get ActivityIndicator" /* 17 */;
2026-09-02 09:53:35 +00:00
import { AnalyticEvents } from "ME" /* 673 */;
import { CollectiblesMobileShopScreen as closure_6 } from "items" /* 675 */;
import ContentDismissActionType from "ContentDismissActionType" /* 1383 */;
import { RewardFilterTypes } from "QuestsExperimentLocations" /* 5404 */;
2026-08-24 06:08:38 +00:00
import jsxProd from "jsxProd" /* 21 */;
import createCacheKey from "createCacheKey" /* 4481 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-07-20 16:05:17 +00:00
function BalanceWidget(arg0) {
({ onPress, style, accessibilityLabel, accessibilityState, children } = arg0);
2026-08-31 15:47:37 +00:00
const tmp = callback3();
2026-07-29 08:29:29 +00:00
let obj = { onPress, style: items, accessible: true, accessibilityRole: "button", accessibilityLabel, accessibilityState, activeOpacity: 0.8, children: null };
2026-07-23 10:11:24 +00:00
items = [tmp.pressable, style];
2026-07-29 08:29:29 +00:00
obj = { variant: "text-sm/semibold", color: "text-default", style: tmp.label, children: null };
2026-08-24 06:08:38 +00:00
const intl = getSystemLocale.intl;
obj[3] = intl.string(getSystemLocale.t.gGtZpz);
const items1 = [callback(Text.Text, obj), ];
2026-07-20 16:05:17 +00:00
obj = { style: tmp.pill, children };
items1[1] = callback(View, obj);
2026-07-29 08:29:29 +00:00
obj[7] = items1;
2026-08-24 06:08:38 +00:00
return callback2(PressableBase.PressableOpacity, obj);
2026-07-20 16:05:17 +00:00
}
class OrbsOnboardingMenuDismissibleContent {
constructor(arg0) {
2026-07-23 10:11:24 +00:00
style = global.style;
2026-07-29 08:29:29 +00:00
obj = { contentTypes: null, groupName: null, children: null };
2026-07-23 10:11:24 +00:00
tmp = require("SelectedDismissibleContent");
2026-07-20 16:05:17 +00:00
items = [];
2026-07-23 10:11:24 +00:00
items[0] = require("DismissibleContent").DismissibleContent.VIRTUAL_CURRENCY_MOBILE_ONBOARDING_PILL;
2026-07-29 08:29:29 +00:00
obj[0] = items;
2026-08-24 06:08:38 +00:00
obj[1] = closure_8.VIRTUAL_CURRENCY_MOBILE_ONBOARDING;
2026-07-29 08:29:29 +00:00
obj[2] = function children(markAsDismissed) {
2026-07-23 10:11:24 +00:00
markAsDismissed = markAsDismissed.markAsDismissed;
2026-08-31 15:47:37 +00:00
if (markAsDismissed.visibleContent === style(closure_1_2[11]).DismissibleContent.VIRTUAL_CURRENCY_MOBILE_ONBOARDING_PILL) {
2026-07-20 16:05:17 +00:00
function handleOnboardingPress() {
2026-08-24 06:08:38 +00:00
markAsDismissed(closure_1_7.TAKE_ACTION);
2026-08-31 15:47:37 +00:00
let obj = closure_1_1(closure_1_2[12]);
2026-08-24 06:08:38 +00:00
obj.track(closure_1_5.USER_PROFILE_ACTION, { profile_action: "ORBS_BALANCE_PRESSED" });
2026-08-31 15:47:37 +00:00
obj = { filter: closure_1_9.VIRTUAL_CURRENCY, fromContent: markAsDismissed(closure_1_2[14]).QuestContent.MOBILE_ORBS_ONBOARDING_DC };
markAsDismissed(closure_1_2[13]).openQuestHome(obj);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let obj = { onPress: null, style: null, accessibilityLabel: null, children: null };
obj[0] = handleOnboardingPress;
obj[1] = markAsDismissed;
2026-08-31 15:47:37 +00:00
const intl = tmp(tmp2[9]).intl;
obj[2] = intl.string(tmp(tmp2[9]).t.Kt2QDh);
2026-07-29 08:29:29 +00:00
obj = { onPress: null, accessible: false };
obj[0] = handleOnboardingPress;
2026-08-31 15:47:37 +00:00
obj[3] = closure_1_10(closure_1_1(tmp2[15]), obj);
2026-08-24 06:08:38 +00:00
return closure_1_10(closure_1_12, obj);
2026-07-20 16:05:17 +00:00
} else {
return null;
}
};
return jsx(tmp, obj);
}
}
function BalanceWidgetMenu(style) {
2026-07-29 08:29:29 +00:00
let str;
let obj = str(8780);
2026-07-23 10:11:24 +00:00
str = obj.useFetchVirtualCurrencyBalance().balance;
let items = [str];
2026-07-20 16:05:17 +00:00
const callback = React.useCallback(() => {
2026-08-31 15:47:37 +00:00
let obj = closure_1_1(closure_1_2[12]);
2026-08-24 06:08:38 +00:00
obj.track(closure_1_5.USER_PROFILE_ACTION, { profile_action: "ORBS_BALANCE_PRESSED" });
2026-08-31 15:47:37 +00:00
obj1 = closure_1_1(closure_1_2[17]);
2026-07-29 08:29:29 +00:00
obj = { balance: str, primaryButtonConfig: null, secondaryButtonConfig: null, source: null };
obj = { buttonText: null, onButtonPress: null };
2026-08-31 15:47:37 +00:00
const intl = str(closure_1_2[9]).intl;
obj[0] = intl.string(str(closure_1_2[9]).t.WrzJBf);
2026-07-29 08:29:29 +00:00
obj[1] = function onButtonPress() {
2026-08-31 15:47:37 +00:00
let obj = closure_1_1(closure_1_2[12]);
obj = { type: "GO_TO_SHOP", source: closure_1_1(closure_1_2[20]).YOU_SCREEN, balance: closure_0 };
2026-08-24 06:08:38 +00:00
obj.track(closure_1_5.ORB_BALANCE_ACTION_SHEET_ACTION, obj);
2026-08-31 15:47:37 +00:00
closure_1_1(closure_1_2[17]).hideActionSheet();
const obj3 = closure_1_1(closure_1_2[17]);
2026-07-29 08:29:29 +00:00
obj = { analyticsLocations: null, analyticsSource: null, screen: null };
2026-08-31 15:47:37 +00:00
const items = [closure_1_1(closure_1_2[20]).COLLECTIBLES_SHOP];
2026-07-29 08:29:29 +00:00
obj[0] = items;
2026-08-31 15:47:37 +00:00
obj[1] = closure_1_1(closure_1_2[20]).COLLECTIBLES_SHOP;
2026-08-24 06:08:38 +00:00
obj[2] = closure_1_6.ORBS;
2026-08-31 15:47:37 +00:00
const result = closure_1_0(closure_1_2[21]).openCollectiblesShopMobile(obj);
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
obj[1] = obj;
obj1 = { buttonText: null, onButtonPress: null };
2026-08-31 15:47:37 +00:00
const intl2 = str(closure_1_2[9]).intl;
obj1[0] = intl2.string(str(closure_1_2[9]).t.SymzJC);
2026-07-29 08:29:29 +00:00
obj1[1] = function onButtonPress() {
2026-08-31 15:47:37 +00:00
let obj = closure_1_1(closure_1_2[12]);
obj = { type: "GO_TO_QUEST_HOME", source: closure_1_1(closure_1_2[20]).YOU_SCREEN, balance: closure_0 };
2026-08-24 06:08:38 +00:00
obj.track(closure_1_5.ORB_BALANCE_ACTION_SHEET_ACTION, obj);
2026-08-31 15:47:37 +00:00
closure_1_1(closure_1_2[17]).hideActionSheet();
const obj3 = closure_1_1(closure_1_2[17]);
obj = { mergeExistingRoutes: true, filter: closure_1_9.VIRTUAL_CURRENCY, fromContent: closure_1_0(closure_1_2[14]).QuestContent.ORBS_BALANCE_MENU };
closure_1_0(closure_1_2[13]).openQuestHome(obj);
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
obj[2] = obj1;
2026-08-31 15:47:37 +00:00
obj[3] = closure_1_1(closure_1_2[20]).YOU_SCREEN;
obj1.openLazy(() => callback(paths[19])(paths[18], paths.paths).then((arg0) => arg0.default), "BalanceWidgetMenu", obj);
2026-07-20 16:05:17 +00:00
}, items);
2026-07-29 08:29:29 +00:00
obj = { onPress: callback, style: style.style, accessibilityLabel: null, children: null };
2026-09-02 09:53:35 +00:00
let intl = str(1233).intl;
2026-07-29 08:29:29 +00:00
let str2;
if (str != null) {
str2 = str.toString();
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (str2 == null) {
str2 = "";
2026-07-20 16:05:17 +00:00
}
2026-09-02 09:53:35 +00:00
obj[2] = intl.formatToPlainString(str(1233).t.zPaLL9, { balance: str2 });
2026-08-24 06:08:38 +00:00
obj[3] = closure_10(BalanceWidgetPillButtonDefault, { balance: str, onPress: callback, accessible: false });
2026-07-29 08:29:29 +00:00
return closure_10(BalanceWidget, obj);
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
({ ContentDismissActionType: error, DismissibleContentGroupName: closure_8 } = ContentDismissActionType);
2026-07-29 08:29:29 +00:00
({ jsx: c10, jsxs: unpackModuleId } = jsxProd);
2026-08-31 15:47:37 +00:00
let closure_15 = createCacheKey.createStyles(() => {
let obj = { pressable: null, label: null, pill: null, loadingContainer: null };
obj = { flex: 1, flexDirection: "row", alignItems: "center", flexWrap: "wrap", gap: ThemesDefault.space.PX_8, paddingHorizontal: ThemesDefault.space.PX_8, paddingVertical: ThemesDefault.space.PX_8, borderRadius: ThemesDefault.radii.md };
obj[0] = obj;
obj[1] = { flex: 1 };
obj[2] = { alignItems: "center" };
obj[3] = { height: 36, justifyContent: "center" };
return obj;
2026-07-20 16:05:17 +00:00
});
2026-08-24 06:08:38 +00:00
let result = require("set").fileFinishedImporting("modules/virtual_currency/native/BalanceWidgetMenu.tsx");
2026-07-20 16:05:17 +00:00
export default function BalanceWidgetMenuWrapper(style) {
let obj = _mod8780;
2026-07-20 16:05:17 +00:00
const balance = obj.useFetchVirtualCurrencyBalance().balance;
2026-08-24 06:08:38 +00:00
UNSAFE_isDismissibleContentDismissed;
2026-07-20 16:05:17 +00:00
if (null == balance) {
2026-07-29 08:29:29 +00:00
obj = { onPress: null, style: null, accessibilityLabel: null, accessibilityState: null, children: null };
obj[0] = function onPress() {
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
obj[1] = style.style;
2026-09-02 09:53:35 +00:00
const intl = tmp2(1233).intl;
obj[2] = intl.string(tmp2(1233).t.cKwv4k);
2026-07-29 08:29:29 +00:00
obj[3] = { busy: true };
obj = { style: null, children: null };
2026-08-31 15:47:37 +00:00
obj[0] = tmp.loadingContainer;
obj[1] = callback(tmp2(4952).Ellipsis, { variant: "primary", size: "sm" });
2026-07-29 08:29:29 +00:00
obj[4] = callback(View, obj);
let tmp6Result = callback(BalanceWidget, obj);
2026-07-20 16:05:17 +00:00
} else {
if (balance <= 0) {
2026-07-29 08:29:29 +00:00
if (!tmp5) {
let tmp7 = OrbsOnboardingMenuDismissibleContent;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
obj1 = {};
2026-07-20 16:05:17 +00:00
const merged = Object.assign(style);
2026-07-29 08:29:29 +00:00
tmp6Result = tmp6(tmp7, obj1);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp7 = BalanceWidgetMenu;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp6Result;
2026-07-20 16:05:17 +00:00
};
export { OrbsOnboardingMenuDismissibleContent };