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

182 lines
8.4 KiB
TypeScript
Raw Normal View History

2026-08-28 06:19:39 +00:00
// Module ID: 15228
// Function ID: 15229
2026-07-20 16:05:17 +00:00
// Name: BalanceWidget
2026-08-28 06:19:39 +00:00
// Dependencies: [19, 17, 676, 678, 1388, 5352, 21, 1367, 5033, 4442, 1236, 10355, 1377, 698, 11268, 5355, 15229, 11285, 4413, 10788, 2010, 5938, 7233, 10787, 4267, 4909, 4446, 712, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-28 06:19:39 +00:00
// Module 15228 (BalanceWidget)
2026-08-24 06:08:38 +00:00
import ThemesDefault from "Themes" /* 712 */;
import getSystemLocale from "getSystemLocale" /* 1236 */;
import useIsMobileVisualRefreshExperimentEnabledDefault from "useIsMobileVisualRefreshExperimentEnabled" /* 1367 */;
2026-08-28 06:19:39 +00:00
import UNSAFE_isDismissibleContentDismissed from "UNSAFE_isDismissibleContentDismissed" /* 4267 */;
import Text from "Text" /* 4442 */;
import PressableBase from "PressableBase" /* 5033 */;
import SelectedDismissibleContentDefault from "SelectedDismissibleContent" /* 10355 */;
import BalanceWidgetPillButtonDefault from "BalanceWidgetPillButton" /* 10787 */;
import _mod11285 from "module_11285" /* 11285 */;
2026-08-24 06:08:38 +00:00
import closure_3 from "noop" /* 19 */;
import { View } from "get ActivityIndicator" /* 17 */;
import { AnalyticEvents } from "ME" /* 676 */;
import { CollectiblesMobileShopScreen as closure_6 } from "items" /* 678 */;
import ContentDismissActionType from "ContentDismissActionType" /* 1388 */;
2026-08-28 06:19:39 +00:00
import { RewardFilterTypes } from "QuestsExperimentLocations" /* 5352 */;
2026-08-24 06:08:38 +00:00
import jsxProd from "jsxProd" /* 21 */;
2026-08-28 06:19:39 +00:00
import createCacheKey from "createCacheKey" /* 4446 */;
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-24 06:08:38 +00:00
const tmp = callback3(useIsMobileVisualRefreshExperimentEnabledDefault("BalanceWidgetMenu"));
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-24 06:08:38 +00:00
if (markAsDismissed.visibleContent === style(closure_1_2[12]).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);
let obj = closure_1_1(closure_1_2[13]);
obj.track(closure_1_5.USER_PROFILE_ACTION, { profile_action: "ORBS_BALANCE_PRESSED" });
obj = { filter: closure_1_9.VIRTUAL_CURRENCY, fromContent: markAsDismissed(closure_1_2[15]).QuestContent.MOBILE_ORBS_ONBOARDING_DC };
markAsDismissed(closure_1_2[14]).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;
const intl = tmp(tmp2[10]).intl;
obj[2] = intl.string(tmp(tmp2[10]).t.Kt2QDh);
obj = { onPress: null, accessible: false };
obj[0] = handleOnboardingPress;
2026-08-24 06:08:38 +00:00
obj[3] = closure_1_10(closure_1_1(tmp2[16]), obj);
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;
2026-08-28 06:19:39 +00:00
let obj = str(11285);
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-24 06:08:38 +00:00
let obj = closure_1_1(closure_1_2[13]);
obj.track(closure_1_5.USER_PROFILE_ACTION, { profile_action: "ORBS_BALANCE_PRESSED" });
obj1 = closure_1_1(closure_1_2[18]);
2026-07-29 08:29:29 +00:00
obj = { balance: str, primaryButtonConfig: null, secondaryButtonConfig: null, source: null };
obj = { buttonText: null, onButtonPress: null };
2026-08-24 06:08:38 +00:00
const intl = str(closure_1_2[10]).intl;
obj[0] = intl.string(str(closure_1_2[10]).t.WrzJBf);
2026-07-29 08:29:29 +00:00
obj[1] = function onButtonPress() {
2026-08-24 06:08:38 +00:00
let obj = closure_1_1(closure_1_2[13]);
obj = { type: "GO_TO_SHOP", source: closure_1_1(closure_1_2[21]).YOU_SCREEN, balance: closure_0 };
obj.track(closure_1_5.ORB_BALANCE_ACTION_SHEET_ACTION, obj);
closure_1_1(closure_1_2[18]).hideActionSheet();
const obj3 = closure_1_1(closure_1_2[18]);
2026-07-29 08:29:29 +00:00
obj = { analyticsLocations: null, analyticsSource: null, screen: null };
2026-08-24 06:08:38 +00:00
const items = [closure_1_1(closure_1_2[21]).COLLECTIBLES_SHOP];
2026-07-29 08:29:29 +00:00
obj[0] = items;
2026-08-24 06:08:38 +00:00
obj[1] = closure_1_1(closure_1_2[21]).COLLECTIBLES_SHOP;
obj[2] = closure_1_6.ORBS;
const result = closure_1_0(closure_1_2[22]).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-24 06:08:38 +00:00
const intl2 = str(closure_1_2[10]).intl;
obj1[0] = intl2.string(str(closure_1_2[10]).t.SymzJC);
2026-07-29 08:29:29 +00:00
obj1[1] = function onButtonPress() {
2026-08-24 06:08:38 +00:00
let obj = closure_1_1(closure_1_2[13]);
obj = { type: "GO_TO_QUEST_HOME", source: closure_1_1(closure_1_2[21]).YOU_SCREEN, balance: closure_0 };
obj.track(closure_1_5.ORB_BALANCE_ACTION_SHEET_ACTION, obj);
closure_1_1(closure_1_2[18]).hideActionSheet();
const obj3 = closure_1_1(closure_1_2[18]);
obj = { mergeExistingRoutes: true, filter: closure_1_9.VIRTUAL_CURRENCY, fromContent: closure_1_0(closure_1_2[15]).QuestContent.ORBS_BALANCE_MENU };
closure_1_0(closure_1_2[14]).openQuestHome(obj);
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
obj[2] = obj1;
2026-08-24 06:08:38 +00:00
obj[3] = closure_1_1(closure_1_2[21]).YOU_SCREEN;
2026-07-29 08:29:29 +00:00
obj1.openLazy(() => callback(paths[20])(paths[19], 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 };
let intl = str(1236).intl;
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-07-29 08:29:29 +00:00
obj[2] = intl.formatToPlainString(str(1236).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);
let closure_15 = createCacheKey.createStyles((arg0) => {
2026-08-24 06:08:38 +00:00
const pressable = { flex: 1, flexDirection: "row", alignItems: "center", flexWrap: "wrap", gap: ThemesDefault.space.PX_8 };
2026-07-20 16:05:17 +00:00
if (arg0) {
2026-07-29 08:29:29 +00:00
let obj = { paddingHorizontal: null, paddingVertical: null };
obj[0] = tmp(712).space.PX_8;
obj[1] = tmp(712).space.PX_8;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
obj = { padding: 16 };
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const merged = Object.assign(obj);
const radii = tmp(712).radii;
pressable.borderRadius = arg0 ? radii.md : radii.lg;
return { pressable, label: { flex: 1 }, pill: { alignItems: "center" }, loadingContainer: { height: 36, justifyContent: "center" } };
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) {
2026-08-28 06:19:39 +00:00
let obj = _mod11285;
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;
const intl = tmp3(1236).intl;
obj[2] = intl.string(tmp3(1236).t.cKwv4k);
obj[3] = { busy: true };
obj = { style: null, children: null };
obj[0] = tmp2.loadingContainer;
2026-08-28 06:19:39 +00:00
obj[1] = callback(tmp3(4909).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 };