181 lines
8.4 KiB
TypeScript
181 lines
8.4 KiB
TypeScript
// Module ID: 15243
|
|
// Function ID: 15244
|
|
// Name: BalanceWidget
|
|
// Dependencies: [19, 17, 676, 678, 1388, 5268, 21, 1367, 4949, 4376, 1236, 10151, 1377, 698, 11326, 5271, 15244, 9568, 4347, 10305, 2009, 5854, 7147, 10304, 4201, 4830, 4380, 712, 2]
|
|
// Exports: default
|
|
|
|
// Module 15243 (BalanceWidget)
|
|
import ThemesDefault from "Themes" /* 712 */;
|
|
import getSystemLocale from "getSystemLocale" /* 1236 */;
|
|
import useIsMobileVisualRefreshExperimentEnabledDefault from "useIsMobileVisualRefreshExperimentEnabled" /* 1367 */;
|
|
import UNSAFE_isDismissibleContentDismissed from "UNSAFE_isDismissibleContentDismissed" /* 4201 */;
|
|
import Text from "Text" /* 4376 */;
|
|
import PressableBase from "PressableBase" /* 4949 */;
|
|
import _mod9568 from "module_9568" /* 9568 */;
|
|
import SelectedDismissibleContentDefault from "SelectedDismissibleContent" /* 10151 */;
|
|
import BalanceWidgetPillButtonDefault from "BalanceWidgetPillButton" /* 10304 */;
|
|
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 */;
|
|
import { RewardFilterTypes } from "QuestsExperimentLocations" /* 5268 */;
|
|
import jsxProd from "jsxProd" /* 21 */;
|
|
import createCacheKey from "createCacheKey" /* 4380 */;
|
|
|
|
require = arg1;
|
|
function BalanceWidget(arg0) {
|
|
({ onPress, style, accessibilityLabel, accessibilityState, children } = arg0);
|
|
const tmp = callback3(useIsMobileVisualRefreshExperimentEnabledDefault("BalanceWidgetMenu"));
|
|
let obj = { onPress, style: items, accessible: true, accessibilityRole: "button", accessibilityLabel, accessibilityState, activeOpacity: 0.8, children: null };
|
|
items = [tmp.pressable, style];
|
|
obj = { variant: "text-sm/semibold", color: "text-default", style: tmp.label, children: null };
|
|
const intl = getSystemLocale.intl;
|
|
obj[3] = intl.string(getSystemLocale.t.gGtZpz);
|
|
const items1 = [callback(Text.Text, obj), ];
|
|
obj = { style: tmp.pill, children };
|
|
items1[1] = callback(View, obj);
|
|
obj[7] = items1;
|
|
return callback2(PressableBase.PressableOpacity, obj);
|
|
}
|
|
class OrbsOnboardingMenuDismissibleContent {
|
|
constructor(arg0) {
|
|
style = global.style;
|
|
obj = { contentTypes: null, groupName: null, children: null };
|
|
tmp = require("SelectedDismissibleContent");
|
|
items = [];
|
|
items[0] = require("DismissibleContent").DismissibleContent.VIRTUAL_CURRENCY_MOBILE_ONBOARDING_PILL;
|
|
obj[0] = items;
|
|
obj[1] = closure_8.VIRTUAL_CURRENCY_MOBILE_ONBOARDING;
|
|
obj[2] = function children(markAsDismissed) {
|
|
markAsDismissed = markAsDismissed.markAsDismissed;
|
|
if (markAsDismissed.visibleContent === style(closure_1_2[12]).DismissibleContent.VIRTUAL_CURRENCY_MOBILE_ONBOARDING_PILL) {
|
|
function handleOnboardingPress() {
|
|
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);
|
|
}
|
|
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;
|
|
obj[3] = closure_1_10(closure_1_1(tmp2[16]), obj);
|
|
return closure_1_10(closure_1_12, obj);
|
|
} else {
|
|
return null;
|
|
}
|
|
};
|
|
return jsx(tmp, obj);
|
|
}
|
|
}
|
|
function BalanceWidgetMenu(style) {
|
|
let str;
|
|
let obj = str(9568);
|
|
str = obj.useFetchVirtualCurrencyBalance().balance;
|
|
let items = [str];
|
|
const callback = React.useCallback(() => {
|
|
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]);
|
|
obj = { balance: str, primaryButtonConfig: null, secondaryButtonConfig: null, source: null };
|
|
obj = { buttonText: null, onButtonPress: null };
|
|
const intl = str(closure_1_2[10]).intl;
|
|
obj[0] = intl.string(str(closure_1_2[10]).t.WrzJBf);
|
|
obj[1] = function onButtonPress() {
|
|
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]);
|
|
obj = { analyticsLocations: null, analyticsSource: null, screen: null };
|
|
const items = [closure_1_1(closure_1_2[21]).COLLECTIBLES_SHOP];
|
|
obj[0] = items;
|
|
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);
|
|
};
|
|
obj[1] = obj;
|
|
obj1 = { buttonText: null, onButtonPress: null };
|
|
const intl2 = str(closure_1_2[10]).intl;
|
|
obj1[0] = intl2.string(str(closure_1_2[10]).t.SymzJC);
|
|
obj1[1] = function onButtonPress() {
|
|
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);
|
|
};
|
|
obj[2] = obj1;
|
|
obj[3] = closure_1_1(closure_1_2[21]).YOU_SCREEN;
|
|
obj1.openLazy(() => callback(paths[20])(paths[19], paths.paths).then((arg0) => arg0.default), "BalanceWidgetMenu", obj);
|
|
}, items);
|
|
obj = { onPress: callback, style: style.style, accessibilityLabel: null, children: null };
|
|
let intl = str(1236).intl;
|
|
let str2;
|
|
if (str != null) {
|
|
str2 = str.toString();
|
|
}
|
|
if (str2 == null) {
|
|
str2 = "";
|
|
}
|
|
obj[2] = intl.formatToPlainString(str(1236).t.zPaLL9, { balance: str2 });
|
|
obj[3] = closure_10(BalanceWidgetPillButtonDefault, { balance: str, onPress: callback, accessible: false });
|
|
return closure_10(BalanceWidget, obj);
|
|
}
|
|
({ ContentDismissActionType: error, DismissibleContentGroupName: closure_8 } = ContentDismissActionType);
|
|
({ jsx: c10, jsxs: unpackModuleId } = jsxProd);
|
|
let closure_15 = createCacheKey.createStyles((arg0) => {
|
|
const pressable = { flex: 1, flexDirection: "row", alignItems: "center", flexWrap: "wrap", gap: ThemesDefault.space.PX_8 };
|
|
if (arg0) {
|
|
let obj = { paddingHorizontal: null, paddingVertical: null };
|
|
obj[0] = tmp(712).space.PX_8;
|
|
obj[1] = tmp(712).space.PX_8;
|
|
} else {
|
|
obj = { padding: 16 };
|
|
}
|
|
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" } };
|
|
});
|
|
let result = require("set").fileFinishedImporting("modules/virtual_currency/native/BalanceWidgetMenu.tsx");
|
|
|
|
export default function BalanceWidgetMenuWrapper(style) {
|
|
let obj = _mod9568;
|
|
const balance = obj.useFetchVirtualCurrencyBalance().balance;
|
|
UNSAFE_isDismissibleContentDismissed;
|
|
if (null == balance) {
|
|
obj = { onPress: null, style: null, accessibilityLabel: null, accessibilityState: null, children: null };
|
|
obj[0] = function onPress() {
|
|
|
|
};
|
|
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;
|
|
obj[1] = callback(tmp3(4830).Ellipsis, { variant: "primary", size: "sm" });
|
|
obj[4] = callback(View, obj);
|
|
let tmp6Result = callback(BalanceWidget, obj);
|
|
} else {
|
|
if (balance <= 0) {
|
|
if (!tmp5) {
|
|
let tmp7 = OrbsOnboardingMenuDismissibleContent;
|
|
}
|
|
obj1 = {};
|
|
const merged = Object.assign(style);
|
|
tmp6Result = tmp6(tmp7, obj1);
|
|
}
|
|
tmp7 = BalanceWidgetMenu;
|
|
}
|
|
return tmp6Result;
|
|
};
|
|
export { OrbsOnboardingMenuDismissibleContent };
|