2026-09-10 05:38:07 +00:00
|
|
|
// Module ID: 14682
|
|
|
|
|
// Function ID: 14683
|
2026-07-20 16:05:17 +00:00
|
|
|
// Name: EditGuildIdentityAvatar
|
2026-09-10 05:38:07 +00:00
|
|
|
// Dependencies: [19, 2021, 1371, 1074, 1373, 21, 4574, 504, 7176, 7196, 8185, 14637, 8195, 4231, 8192, 9345, 4541, 14638, 1896, 14639, 14639, 8183, 5137, 1114, 8283, 14640, 2]
|
2026-07-20 16:05:17 +00:00
|
|
|
// Exports: default
|
|
|
|
|
|
2026-09-10 05:38:07 +00:00
|
|
|
// Module 14682 (EditGuildIdentityAvatar)
|
|
|
|
|
import asyncRequireImpl from "asyncRequireImpl" /* 1896 */;
|
|
|
|
|
import noop from "module_19" /* 19 */;
|
|
|
|
|
import GuildMemberStore from "GuildMemberStore" /* 2021 */;
|
|
|
|
|
import UserStore from "UserStore" /* 1371 */;
|
2026-07-23 10:11:24 +00:00
|
|
|
|
2026-09-10 05:38:07 +00:00
|
|
|
require = fn;
|
|
|
|
|
const Constants = fn(1074);
|
|
|
|
|
({ AnalyticsSections: metroRequire, AnalyticsObjects: closure_7, UpsellTypes: closure_8 } = Constants);
|
|
|
|
|
const PremiumUpsellTypes = fn(1373).PremiumUpsellTypes;
|
|
|
|
|
const jsxProd = fn(21);
|
|
|
|
|
({ jsx: c10, jsxs: closure_11 } = jsxProd);
|
|
|
|
|
const createStyles = fn(4574);
|
|
|
|
|
let closure_12 = createStyles.createStyles({ editAvatarIcon: { position: "absolute", right: 0 } });
|
|
|
|
|
const size = fn(2);
|
|
|
|
|
let result = size.fileFinishedImporting("modules/guild_identity/native/EditGuildIdentityAvatar.tsx");
|
2026-07-20 16:05:17 +00:00
|
|
|
|
|
|
|
|
export default function EditGuildIdentityAvatar(userId) {
|
|
|
|
|
const guildId = userId.guildId;
|
|
|
|
|
({ disabled, disableStatus } = userId);
|
|
|
|
|
if (disableStatus === undefined) {
|
|
|
|
|
disableStatus = true;
|
|
|
|
|
}
|
2026-07-23 10:11:24 +00:00
|
|
|
let stateFromStores1;
|
|
|
|
|
setPendingAvatar = undefined;
|
2026-09-10 05:38:07 +00:00
|
|
|
let handleUploadAvatarSelect;
|
2026-08-24 06:08:38 +00:00
|
|
|
c8 = undefined;
|
|
|
|
|
let avatarDecoration;
|
2026-07-20 16:05:17 +00:00
|
|
|
({ style, statusStyle, avatarStyle } = userId);
|
2026-09-10 05:38:07 +00:00
|
|
|
let tmp = closure_12();
|
|
|
|
|
const items = [handleUploadAvatarSelect];
|
|
|
|
|
const stateFromStores = guildId(stateFromStores1[7]).useStateFromStores(items, () => handleUploadAvatarSelect.getCurrentUser());
|
2026-07-23 10:11:24 +00:00
|
|
|
let obj = guildId(stateFromStores1[7]);
|
|
|
|
|
const items1 = [setPendingAvatar];
|
2026-09-10 05:38:07 +00:00
|
|
|
stateFromStores1 = guildId(stateFromStores1[7]).useStateFromStores(items1, () => {
|
2026-07-20 16:05:17 +00:00
|
|
|
let member = null;
|
|
|
|
|
if (null != stateFromStores) {
|
|
|
|
|
let id;
|
2026-07-29 08:29:29 +00:00
|
|
|
if (tmp != null) {
|
|
|
|
|
id = tmp.id;
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
2026-09-10 05:38:07 +00:00
|
|
|
member = GuildMemberStore.getMember(guildId, id);
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
return member;
|
|
|
|
|
});
|
2026-09-10 05:38:07 +00:00
|
|
|
let obj2 = guildId(stateFromStores1[7]);
|
|
|
|
|
const analyticsLocations = stateFromStores(stateFromStores1[8])(stateFromStores(stateFromStores1[9]).EDIT_AVATAR).analyticsLocations;
|
2026-07-29 08:29:29 +00:00
|
|
|
const tmp7 = stateFromStores(stateFromStores1[8]);
|
2026-07-23 10:11:24 +00:00
|
|
|
({ pendingAvatar, pendingAvatarDecoration, setPendingAvatar } = stateFromStores(stateFromStores1[10])({ guildId, analyticsLocations }));
|
2026-07-29 08:29:29 +00:00
|
|
|
const tmp9 = stateFromStores(stateFromStores1[11])({ guildId, analyticsLocations });
|
2026-09-10 05:38:07 +00:00
|
|
|
handleUploadAvatarSelect = tmp9;
|
2026-07-29 08:29:29 +00:00
|
|
|
const tmp8 = stateFromStores(stateFromStores1[10])({ guildId, analyticsLocations });
|
2026-07-23 10:11:24 +00:00
|
|
|
const pendingAvatarSrc = guildId(stateFromStores1[12]).getPendingAvatarSrc({ userId: userId.userId, image: pendingAvatar });
|
2026-09-10 05:38:07 +00:00
|
|
|
let obj3 = guildId(stateFromStores1[12]);
|
2026-07-23 10:11:24 +00:00
|
|
|
let result = stateFromStores(stateFromStores1[13]).canUsePremiumGuildMemberProfile(stateFromStores);
|
|
|
|
|
c6 = result;
|
2026-09-10 05:38:07 +00:00
|
|
|
let obj4 = stateFromStores(stateFromStores1[13]);
|
2026-07-29 08:29:29 +00:00
|
|
|
const tmp12 = !stateFromStores(stateFromStores1[13]).canUseAnimatedAvatar(stateFromStores);
|
2026-09-10 05:38:07 +00:00
|
|
|
const showAnimatedAvatarUpsell = tmp12;
|
2026-07-23 10:11:24 +00:00
|
|
|
const obj5 = stateFromStores(stateFromStores1[13]);
|
2026-07-20 16:05:17 +00:00
|
|
|
let avatar;
|
2026-07-29 08:29:29 +00:00
|
|
|
if (stateFromStores1 != null) {
|
2026-07-20 16:05:17 +00:00
|
|
|
avatar = stateFromStores1.avatar;
|
|
|
|
|
}
|
2026-07-23 10:11:24 +00:00
|
|
|
const showRemoveAvatarResult = guildId(stateFromStores1[14]).showRemoveAvatar(pendingAvatar, avatar);
|
|
|
|
|
c8 = showRemoveAvatarResult;
|
2026-07-29 08:29:29 +00:00
|
|
|
let tmp15 = pendingAvatarDecoration;
|
2026-07-20 16:05:17 +00:00
|
|
|
if (undefined === pendingAvatarDecoration) {
|
2026-08-24 06:08:38 +00:00
|
|
|
avatarDecoration = undefined;
|
2026-07-29 08:29:29 +00:00
|
|
|
if (stateFromStores1 != null) {
|
2026-07-20 16:05:17 +00:00
|
|
|
avatarDecoration = stateFromStores1.avatarDecoration;
|
|
|
|
|
}
|
2026-07-29 08:29:29 +00:00
|
|
|
tmp15 = avatarDecoration;
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
2026-08-24 06:08:38 +00:00
|
|
|
avatarDecoration = tmp15;
|
2026-07-29 08:29:29 +00:00
|
|
|
const items2 = [guildId, stateFromStores1, stateFromStores, result, tmp12, showRemoveAvatarResult, tmp15, analyticsLocations, tmp9, setPendingAvatar];
|
|
|
|
|
let tmp19Result = null;
|
2026-07-20 16:05:17 +00:00
|
|
|
if (null != stateFromStores) {
|
2026-09-10 05:38:07 +00:00
|
|
|
const obj7 = { style, disabled, onPress: tmp17, accessibilityRole: "button", accessibilityLabel: null, children: null };
|
2026-07-29 08:29:29 +00:00
|
|
|
const intl = tmp2(tmp3[23]).intl;
|
2026-09-10 05:38:07 +00:00
|
|
|
obj7.accessibilityLabel = intl.string(tmp2(tmp3[23]).t["70lEQe"]);
|
|
|
|
|
const obj8 = { user: stateFromStores, guildId: null, pendingAvatarSrc: null, pendingAvatarDecoration: null, statusStyle: null, disableStatus: null, style: null };
|
2026-07-20 16:05:17 +00:00
|
|
|
let tmp23;
|
|
|
|
|
if (null !== pendingAvatar) {
|
|
|
|
|
tmp23 = guildId;
|
|
|
|
|
}
|
2026-09-10 05:38:07 +00:00
|
|
|
obj8.guildId = tmp23;
|
2026-07-20 16:05:17 +00:00
|
|
|
let tmp24;
|
|
|
|
|
if (null !== pendingAvatar) {
|
|
|
|
|
tmp24 = pendingAvatarSrc;
|
|
|
|
|
}
|
2026-09-10 05:38:07 +00:00
|
|
|
obj8.pendingAvatarSrc = tmp24;
|
|
|
|
|
obj8.pendingAvatarDecoration = pendingAvatarDecoration;
|
|
|
|
|
obj8.statusStyle = statusStyle;
|
|
|
|
|
obj8.disableStatus = disableStatus;
|
|
|
|
|
obj8.style = avatarStyle;
|
|
|
|
|
const items3 = [closure_10(tmp6(tmp3[24]), obj8), ];
|
2026-07-29 08:29:29 +00:00
|
|
|
let tmp20Result = !disabled;
|
|
|
|
|
if (!disabled) {
|
2026-09-10 05:38:07 +00:00
|
|
|
const obj9 = { style: tmp.editAvatarIcon };
|
|
|
|
|
tmp20Result = tmp20(tmp6(tmp3[25]), obj9);
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
2026-07-29 08:29:29 +00:00
|
|
|
items3[1] = tmp20Result;
|
2026-09-10 05:38:07 +00:00
|
|
|
obj7.children = items3;
|
|
|
|
|
tmp19Result = closure_11(tmp2(tmp3[22]).PressableOpacity, obj7);
|
2026-07-29 08:29:29 +00:00
|
|
|
const tmp6Result = tmp6(tmp3[24]);
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
2026-07-29 08:29:29 +00:00
|
|
|
return tmp19Result;
|
2026-07-20 16:05:17 +00:00
|
|
|
};
|