decord/source/modules/user_profile/native/ChangeAvatarActionSheet.tsx

148 lines
6.6 KiB
TypeScript
Raw Normal View History

2026-08-08 06:10:11 +00:00
// Module ID: 13918
// Function ID: 13919
2026-07-20 16:05:17 +00:00
// Name: ChangeAvatarActionSheet
2026-08-08 06:10:11 +00:00
// Dependencies: [19, 17, 1903, 676, 21, 4303, 712, 589, 3947, 5764, 5396, 1236, 7704, 5767, 5374, 7967, 13902, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-08 06:10:11 +00:00
// Module 13918 (ChangeAvatarActionSheet)
2026-07-29 08:29:29 +00:00
import "noop";
import { View } from "set";
import mergeGuildAvatar from "mergeGuildAvatar";
2026-07-23 10:11:24 +00:00
import { AnalyticsObjects } from "ME";
import jsxProd from "jsxProd";
2026-07-29 08:29:29 +00:00
import createCacheKey from "createCacheKey";
2026-07-23 10:11:24 +00:00
let closure_6;
2026-07-29 08:29:29 +00:00
let error;
let metroImportAll;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
({ jsx: closure_6, jsxs: error, Fragment: metroImportAll } = jsxProd);
createCacheKey = { nitroWheel: null, sublabel: null, label: null, remove: null, upsellButton: null, upsellTitleContainer: null, titleWrapper: null, titleContainer: null };
createCacheKey = { marginLeft: require("Themes").space.PX_8 };
createCacheKey[0] = createCacheKey;
createCacheKey[1] = { color: require("Themes").colors.TEXT_DEFAULT };
let obj1 = { color: require("Themes").colors.TEXT_DEFAULT };
createCacheKey[2] = { marginBottom: 4, color: require("Themes").colors.INTERACTIVE_TEXT_ACTIVE, alignItems: "center", flexDirection: "row" };
let obj2 = { marginBottom: 4, color: require("Themes").colors.INTERACTIVE_TEXT_ACTIVE, alignItems: "center", flexDirection: "row" };
createCacheKey[3] = { color: require("Themes").colors.TEXT_FEEDBACK_CRITICAL };
let obj3 = { color: require("Themes").colors.TEXT_FEEDBACK_CRITICAL };
createCacheKey[4] = { marginTop: require("Themes").space.PX_12, marginBottom: require("Themes").space.PX_8 };
createCacheKey[5] = { flexDirection: "row", alignItems: "flex-end" };
createCacheKey[6] = { flex: 0 };
createCacheKey[7] = { justifyContent: "flex-start" };
createCacheKey = createCacheKey.createStyles(createCacheKey);
let obj4 = { marginTop: require("Themes").space.PX_12, marginBottom: require("Themes").space.PX_8 };
const result = require("mergeGuildAvatar").fileFinishedImporting("modules/user_profile/native/ChangeAvatarActionSheet.tsx");
2026-07-20 16:05:17 +00:00
export default function ChangeAvatarActionSheet(showRemoveAvatar) {
let handleEditAvatarDecorationSelect;
let handleRemoveAvatarSelect;
let handleUploadAvatarSelect;
let handleUploadGIFAvatarSelect;
let showAnimatedAvatarUpsell;
({ handleUploadGIFAvatarSelect, handleEditAvatarDecorationSelect, showAnimatedAvatarUpsell } = showRemoveAvatar);
({ handleUploadAvatarSelect, handleRemoveAvatarSelect } = showRemoveAvatar);
if (showAnimatedAvatarUpsell === undefined) {
showAnimatedAvatarUpsell = false;
}
let flag = showRemoveAvatar.showRemoveAvatar;
if (flag === undefined) {
flag = false;
}
2026-07-29 08:29:29 +00:00
const tmp = createCacheKey();
let obj = require(589) /* initialize */;
const items = [mergeGuildAvatar];
const stateFromStores = obj.useStateFromStores(items, () => currentUser.getCurrentUser());
2026-08-07 06:50:47 +00:00
let obj1 = importDefault(3947);
2026-07-20 16:05:17 +00:00
let isPremiumResult = obj1.isPremium(stateFromStores);
2026-07-29 08:29:29 +00:00
obj = { title: null, trailing: null, titleWrapperStyle: null, titleContainerStyle: null };
const intl = require(1236) /* getSystemLocale */.intl;
obj[0] = intl.string(require(1236) /* getSystemLocale */.t.lqaIxI);
2026-07-20 16:05:17 +00:00
if (isPremiumResult) {
2026-08-08 06:10:11 +00:00
isPremiumResult = tmp8(tmp2(7704).NitroWheelIcon, {});
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[1] = isPremiumResult;
({ titleWrapper: obj3[2], titleContainer: obj3[3] } = tmp);
2026-08-08 06:10:11 +00:00
const items1 = [closure_6(require(5396) /* RedesignBottomSheetTitleHeaderBase */.BottomSheetTitleHeader, obj), ];
2026-07-29 08:29:29 +00:00
obj = { label: null, subLabel: null, onPress: null };
const intl2 = tmp2(1236).intl;
obj[0] = intl2.string(require(1236) /* getSystemLocale */.t["MsUY/S"]);
const intl3 = tmp2(1236).intl;
obj[1] = intl3.string(require(1236) /* getSystemLocale */.t.r5hKOy);
obj[2] = handleUploadAvatarSelect;
2026-08-08 06:10:11 +00:00
const items2 = [closure_6(require(5374) /* TableRowInner */.TableRow, obj), , , , ];
2026-07-29 08:29:29 +00:00
let tmp8Result = null != handleUploadGIFAvatarSelect && !showAnimatedAvatarUpsell;
if (tmp8Result) {
obj1 = { label: null, onPress: null };
const intl4 = tmp2(1236).intl;
obj1[0] = intl4.string(tmp2(1236).t["xsC+/y"]);
obj1[1] = handleUploadGIFAvatarSelect;
2026-08-08 06:10:11 +00:00
tmp8Result = tmp8(tmp2(5374).TableRow, obj1);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
items2[1] = tmp8Result;
2026-07-20 16:05:17 +00:00
if (showAnimatedAvatarUpsell) {
2026-07-29 08:29:29 +00:00
const obj2 = { label: null, subLabel: null };
const obj3 = { style: null, children: null };
obj3[0] = tmp.upsellTitleContainer;
const obj4 = { text: null };
const intl5 = tmp2(1236).intl;
obj4[0] = intl5.string(tmp2(1236).t.xZ0Wot);
2026-08-08 06:10:11 +00:00
const items3 = [tmp8(tmp2(7967).FormLabel, obj4), ];
2026-07-29 08:29:29 +00:00
const obj5 = { style: null, size: "sm" };
obj5[0] = tmp.nitroWheel;
2026-08-08 06:10:11 +00:00
items3[1] = tmp8(tmp2(7704).NitroWheelIcon, obj5);
2026-07-29 08:29:29 +00:00
obj3[1] = items3;
obj2[0] = tmp7(View, obj3);
const obj6 = { children: null };
const obj7 = { style: null, numberOfLines: 3, text: null };
obj7[0] = tmp.sublabel;
const intl6 = tmp2(1236).intl;
obj7[2] = intl6.string(tmp2(1236).t.L3UPqR);
2026-08-08 06:10:11 +00:00
const items4 = [tmp8(tmp2(7967).FormSubLabel, obj7), ];
2026-07-29 08:29:29 +00:00
const obj8 = { style: null, children: null };
obj8[0] = tmp.upsellButton;
const obj9 = { analyticsObject: null, label: null };
obj9[0] = AnalyticsObjects.ANIMATED_AVATAR;
const intl7 = tmp2(1236).intl;
obj9[1] = intl7.string(tmp2(1236).t.mr4K7D);
2026-08-08 06:10:11 +00:00
obj8[1] = tmp8(importDefault(13902), obj9);
2026-07-29 08:29:29 +00:00
items4[1] = tmp8(View, obj8);
obj6[0] = items4;
obj2[1] = tmp7(closure_8, obj6);
2026-08-08 06:10:11 +00:00
showAnimatedAvatarUpsell = tmp8(tmp2(5374).TableRow, obj2);
const tmp5Result = importDefault(13902);
2026-07-20 16:05:17 +00:00
}
items2[2] = showAnimatedAvatarUpsell;
2026-07-29 08:29:29 +00:00
tmp8Result = null != handleEditAvatarDecorationSelect;
if (tmp8Result) {
const obj10 = { label: null, onPress: null };
const obj11 = { style: null, children: null };
obj11[0] = tmp.upsellTitleContainer;
const obj12 = { text: null };
const intl8 = tmp2(1236).intl;
obj12[0] = intl8.string(tmp2(1236).t.BVcYCx);
2026-08-08 06:10:11 +00:00
obj11[1] = tmp8(tmp2(7967).FormLabel, obj12);
2026-07-29 08:29:29 +00:00
obj10[0] = tmp8(View, obj11);
obj10[1] = handleEditAvatarDecorationSelect;
2026-08-08 06:10:11 +00:00
tmp8Result = tmp8(tmp2(5374).TableRow, obj10);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
items2[3] = tmp8Result;
2026-07-20 16:05:17 +00:00
if (flag) {
2026-07-29 08:29:29 +00:00
const obj13 = { label: null, onPress: null };
const obj14 = { style: null, text: null };
2026-07-20 16:05:17 +00:00
const items5 = [, ];
({ label: arr6[0], remove: arr6[1] } = tmp);
2026-07-29 08:29:29 +00:00
obj14[0] = items5;
const intl9 = tmp2(1236).intl;
obj14[1] = intl9.string(tmp2(1236).t.twB3fz);
2026-08-08 06:10:11 +00:00
obj13[0] = tmp8(tmp2(7967).FormLabel, obj14);
2026-07-29 08:29:29 +00:00
obj13[1] = handleRemoveAvatarSelect;
2026-08-08 06:10:11 +00:00
flag = tmp8(tmp2(5374).TableRow, obj13);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const obj15 = { children: null };
2026-07-20 16:05:17 +00:00
items2[4] = flag;
2026-08-08 06:10:11 +00:00
items1[1] = closure_7(require(5767) /* TableRowGroupTitle */.TableRowGroup, { hasIcons: false, children: items2 });
2026-07-29 08:29:29 +00:00
obj15[0] = items1;
2026-08-08 06:10:11 +00:00
return closure_7(require(5764) /* ActionSheet */.ActionSheet, obj15);
2026-07-20 16:05:17 +00:00
};