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

147 lines
6 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 14119
// Function ID: 14120
2026-07-20 16:05:17 +00:00
// Name: COLLECTIBLES_PREVIEW_SIZE
2026-08-24 06:08:38 +00:00
// Dependencies: [32, 19, 17, 7224, 1388, 505, 21, 712, 4668, 9270, 7404, 1377, 8415, 10416, 1949, 4346, 14120, 2008, 1236, 14104, 5451, 9262, 1297, 8436, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-24 06:08:38 +00:00
// Module 14119 (COLLECTIBLES_PREVIEW_SIZE)
import ThemesDefault from "Themes" /* 712 */;
import closure_3 from "_slicedToArray" /* 32 */;
import closure_4 from "noop" /* 19 */;
import { View } from "get ActivityIndicator" /* 17 */;
import { COLLECTIBLES_PREVIEW_SIZE } from "ARBITRARY_LARGE_OFFSET" /* 7224 */;
import { ContentDismissActionType } from "ContentDismissActionType" /* 1388 */;
import { NOOP } from "sum" /* 505 */;
import { jsx } from "jsxProd" /* 21 */;
import createCacheKey from "createCacheKey" /* 4668 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-08-24 06:08:38 +00:00
const PX_4 = ThemesDefault.space.PX_4;
2026-08-05 07:35:12 +00:00
createCacheKey = { previewContainer: null, noneIcon: null };
2026-08-24 06:08:38 +00:00
createCacheKey = { height: COLLECTIBLES_PREVIEW_SIZE, width: COLLECTIBLES_PREVIEW_SIZE, paddingVertical: PX_4, backgroundColor: ThemesDefault.colors.BACKGROUND_MOD_MUTED, justifyContent: "center", alignItems: "center", borderRadius: ThemesDefault.radii.xs, overflow: "hidden" };
2026-07-29 08:29:29 +00:00
createCacheKey[0] = createCacheKey;
2026-08-24 06:08:38 +00:00
createCacheKey[1] = { tintColor: ThemesDefault.colors.TEXT_SUBTLE };
let closure_11 = createCacheKey.createStyles(createCacheKey);
let obj1 = { tintColor: ThemesDefault.colors.TEXT_SUBTLE };
const result = require("set").fileFinishedImporting("modules/user_profile/native/UserProfileFrameEditButton.tsx");
2026-07-20 16:05:17 +00:00
export default function UserProfileFrameEditButton(arg0) {
({ displayProfile, user } = arg0);
({ pendingProfileFrame, guildId } = arg0);
2026-08-24 06:08:38 +00:00
dependencyMap = undefined;
2026-07-23 10:11:24 +00:00
let userProfileFrame;
2026-08-24 06:08:38 +00:00
const tmp = callback();
let obj = user(9270);
2026-07-20 16:05:17 +00:00
const canViewProfileFramesInCollectiblesShop = obj.useCanViewProfileFramesInCollectiblesShop("UserProfileFrameEditButton");
2026-08-24 06:08:38 +00:00
obj1 = user(7404);
2026-08-11 06:20:06 +00:00
const items = [user(1377).DismissibleContent.PROFILE_FRAME_USER_PROFILE_NEW_BADGE];
2026-07-29 08:29:29 +00:00
const tmp5 = userProfileFrame(obj1.useSelectedDismissibleContent(items), 2);
dependencyMap = tmp6;
2026-08-24 06:08:38 +00:00
let obj2 = user(8415);
2026-07-29 08:29:29 +00:00
obj = { pendingValue: pendingProfileFrame, userValue: null, guildValue: null, guildId: null };
2026-07-20 16:05:17 +00:00
let profileFrame;
2026-07-29 08:29:29 +00:00
if (displayProfile != null) {
2026-07-20 16:05:17 +00:00
const _userProfile = displayProfile._userProfile;
2026-07-29 08:29:29 +00:00
if (_userProfile != null) {
2026-07-20 16:05:17 +00:00
profileFrame = _userProfile.profileFrame;
}
}
2026-07-29 08:29:29 +00:00
obj[1] = profileFrame;
2026-07-20 16:05:17 +00:00
let profileFrame1;
2026-07-29 08:29:29 +00:00
if (displayProfile != null) {
2026-07-20 16:05:17 +00:00
const _guildMemberProfile = displayProfile._guildMemberProfile;
2026-07-29 08:29:29 +00:00
if (_guildMemberProfile != null) {
2026-07-20 16:05:17 +00:00
profileFrame1 = _guildMemberProfile.profileFrame;
}
}
2026-07-29 08:29:29 +00:00
obj[2] = profileFrame1;
obj[3] = guildId;
2026-07-20 16:05:17 +00:00
const profilePreviewValue = obj2.getProfilePreviewValue(obj);
2026-08-24 06:08:38 +00:00
let tmp2Result = tmp2(10416);
2026-07-20 16:05:17 +00:00
let skuId;
2026-07-29 08:29:29 +00:00
if (profilePreviewValue != null) {
2026-07-20 16:05:17 +00:00
skuId = profilePreviewValue.skuId;
}
2026-07-29 08:29:29 +00:00
const fetchCollectiblesProduct = tmp2Result.useFetchCollectiblesProduct(skuId);
2026-07-20 16:05:17 +00:00
const product = fetchCollectiblesProduct.product;
let type;
2026-07-29 08:29:29 +00:00
if (product != null) {
2026-07-20 16:05:17 +00:00
const first = product.items[0];
2026-07-29 08:29:29 +00:00
if (first != null) {
2026-07-20 16:05:17 +00:00
type = first.type;
}
}
2026-08-11 06:20:06 +00:00
if (type === user(1949).CollectiblesItemType.PROFILE_FRAME) {
2026-07-20 16:05:17 +00:00
const first1 = product.items[0];
}
2026-08-24 06:08:38 +00:00
tmp2Result = tmp2(8415);
2026-07-29 08:29:29 +00:00
userProfileFrame = tmp2Result.useUserProfileFrame({ user, guildId });
2026-07-20 16:05:17 +00:00
if (undefined !== pendingProfileFrame) {
userProfileFrame = pendingProfileFrame;
}
2026-07-29 08:29:29 +00:00
const items1 = [userProfileFrame, guildId, user, tmp5[1]];
2026-07-20 16:05:17 +00:00
if (canViewProfileFramesInCollectiblesShop) {
let name;
2026-07-29 08:29:29 +00:00
if (product != null) {
2026-07-20 16:05:17 +00:00
name = product.name;
}
2026-07-29 08:29:29 +00:00
if (name == null) {
const intl = tmp2(1236).intl;
name = intl.string(tmp2(1236).t.PoWNfe);
2026-07-20 16:05:17 +00:00
}
let formatToPlainStringResult = name;
if (null != guildId) {
formatToPlainStringResult = name;
if (null == userProfileFrame) {
2026-07-29 08:29:29 +00:00
const intl2 = tmp2(1236).intl;
obj = { label: null };
obj[0] = name;
formatToPlainStringResult = intl2.formatToPlainString(tmp2(1236).t.ep5D4i, obj);
2026-07-20 16:05:17 +00:00
}
}
if (fetchCollectiblesProduct.isFetching) {
2026-07-29 08:29:29 +00:00
obj1 = { label: null, buttonText: null, onPress: null, leading: null, loading: true, disabled: true, hideArrow: true };
2026-08-05 07:35:12 +00:00
const intl4 = tmp2(1236).intl;
obj1[0] = intl4.string(tmp2(1236).t.GWrZOd);
2026-07-29 08:29:29 +00:00
const intl5 = tmp2(1236).intl;
2026-08-05 07:35:12 +00:00
obj1[1] = intl5.string(tmp2(1236).t.MKDeyL);
2026-07-29 08:29:29 +00:00
obj1[2] = NOOP;
2026-08-24 06:08:38 +00:00
obj1[3] = tmp19(tmp2(5451).ActivityIndicator, { animating: true, size: "large" });
2026-07-20 16:05:17 +00:00
obj2 = obj1;
} else {
2026-07-29 08:29:29 +00:00
obj2 = { label: null, labelTrailing: null, buttonText: null, accessibilityValue: null, onPress: null, leading: null };
const intl3 = tmp2(1236).intl;
obj2[0] = intl3.string(tmp2(1236).t.GWrZOd);
2026-08-05 07:35:12 +00:00
const obj3 = { showNewBadge: null };
2026-08-11 06:20:06 +00:00
obj3[0] = tmp5[0] === tmp2(1377).DismissibleContent.PROFILE_FRAME_USER_PROFILE_NEW_BADGE;
2026-08-24 06:08:38 +00:00
obj2[1] = tmp19(tmp2(14104).UserProfileEditFormLabelBadges, obj3);
2026-07-29 08:29:29 +00:00
obj2[2] = formatToPlainStringResult;
2026-08-05 07:35:12 +00:00
const obj4 = { text: null };
obj4[0] = formatToPlainStringResult;
obj2[3] = obj4;
2026-07-29 08:29:29 +00:00
obj2[4] = tmp16;
2026-07-20 16:05:17 +00:00
if (null != first1) {
2026-08-05 07:35:12 +00:00
const obj5 = { style: null, children: null };
obj5[0] = tmp.previewContainer;
const obj6 = { profileFrame: null, previewWidth: null, previewHeight: null, profileBackgroundColor: null };
obj6[0] = first1;
obj6[1] = COLLECTIBLES_PREVIEW_SIZE - 2 * guildId(712).space.PX_8;
obj6[2] = COLLECTIBLES_PREVIEW_SIZE - 2 * PX_4;
obj6[3] = guildId(712).colors.BACKGROUND_SURFACE_HIGH;
2026-08-24 06:08:38 +00:00
obj5[1] = tmp19(guildId(9262), obj6);
2026-08-05 07:35:12 +00:00
let tmp19Result = tmp19(View, obj5);
2026-08-24 06:08:38 +00:00
const tmp24 = guildId(9262);
2026-07-20 16:05:17 +00:00
} else {
2026-08-05 07:35:12 +00:00
const obj7 = { source: null, style: null };
2026-08-24 06:08:38 +00:00
obj7[0] = guildId(8436);
2026-08-05 07:35:12 +00:00
obj7[1] = tmp.noneIcon;
tmp19Result = tmp19(tmp2(1297).Icon, obj7);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj2[5] = tmp19Result;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
return jsx(tmp2(14104).UserProfileEditFormButton, obj2);
2026-07-20 16:05:17 +00:00
} else {
return null;
}
};