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

145 lines
5.6 KiB
TypeScript
Raw Normal View History

// Module ID: 14696
// Function ID: 14697
2026-07-20 16:05:17 +00:00
// Name: UserProfilePrimaryGuildEditButton
// Dependencies: [19, 1979, 8019, 21, 4607, 576, 504, 14697, 8251, 8250, 1114, 1115, 4603, 14673, 4574, 14698, 1896, 5636, 9276, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
// Module 14696 (UserProfilePrimaryGuildEditButton)
import nativeDefault from "native" /* 576 */;
import asyncRequireImpl from "asyncRequireImpl" /* 1896 */;
import ActionSheetActionCreatorsDefault from "ActionSheetActionCreators" /* 4574 */;
import noop from "module_19" /* 19 */;
import GuildStore from "GuildStore" /* 1979 */;
2026-07-22 07:54:56 +00:00
require = fn;
const GuildTagBadgeSize = fn(8019).GuildTagBadgeSize;
const jsx = fn(21).jsx;
const createStyles = fn(4607);
let obj2 = { tag: { paddingHorizontal: 6, paddingVertical: 2, columnGap: 4, borderRadius: nativeDefault.radii.sm } };
let closure_6 = createStyles.createStyles(obj2);
const size = fn(2);
const result = size.fileFinishedImporting("modules/user_profile/native/UserProfilePrimaryGuildEditButton.tsx");
2026-07-20 16:05:17 +00:00
export default function UserProfilePrimaryGuildEditButton(arg0) {
({ user, pendingPrimaryGuildId } = arg0);
2026-07-23 10:11:24 +00:00
pendingPrimaryGuildId = undefined;
let userAvailableGuildsWithTags;
2026-07-20 16:05:17 +00:00
function handleSelectPrimaryGuild(primaryGuildId) {
pendingPrimaryGuildId(handleSelectPrimaryGuild[9]).setPendingChanges({ primaryGuildId });
2026-07-20 16:05:17 +00:00
}
({ disabled, tagStyle } = arg0);
if (undefined === pendingPrimaryGuildId) {
const primaryGuild = user.primaryGuild;
2026-07-29 08:29:29 +00:00
let identityEnabled;
if (primaryGuild != null) {
identityEnabled = primaryGuild.identityEnabled;
}
let tmp4 = null;
if (identityEnabled) {
const primaryGuild2 = user.primaryGuild;
let identityGuildId;
if (primaryGuild2 != null) {
identityGuildId = primaryGuild2.identityGuildId;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp4 = identityGuildId;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
pendingPrimaryGuildId = tmp4;
2026-07-20 16:05:17 +00:00
}
const tmp = closure_6();
const items = [GuildStore];
2026-07-20 16:05:17 +00:00
const items1 = [pendingPrimaryGuildId];
const stateFromStores = pendingPrimaryGuildId(handleSelectPrimaryGuild[6]).useStateFromStores(items, () => GuildStore.getGuild(pendingPrimaryGuildId), items1);
const obj = pendingPrimaryGuildId(handleSelectPrimaryGuild[6]);
userAvailableGuildsWithTags = pendingPrimaryGuildId(handleSelectPrimaryGuild[7]).useUserAvailableGuildsWithTags();
const obj2 = pendingPrimaryGuildId(handleSelectPrimaryGuild[7]);
const tmp9 = userAvailableGuildsWithTags.length > 0;
const userPrimaryGuild = pendingPrimaryGuildId(handleSelectPrimaryGuild[8]).getUserPrimaryGuild(user.primaryGuild);
2026-07-20 16:05:17 +00:00
if (null != user) {
2026-08-26 06:04:24 +00:00
let profile;
if (stateFromStores != null) {
profile = stateFromStores.profile;
}
let tag;
if (profile != null) {
tag = profile.tag;
}
if (tag == null) {
let tag1;
if (tmp12) {
tag1 = userPrimaryGuild.tag;
2026-07-20 16:05:17 +00:00
}
2026-08-26 06:04:24 +00:00
tag = tag1;
}
let badge;
if (profile != null) {
badge = profile.badge;
}
if (badge == null) {
let badge1;
if (tmp12) {
badge1 = userPrimaryGuild.badge;
2026-07-20 16:05:17 +00:00
}
2026-08-26 06:04:24 +00:00
badge = badge1;
}
let guildTagBadgeUrl = null != pendingPrimaryGuildId;
if (guildTagBadgeUrl) {
guildTagBadgeUrl = tmp6(tmp7[8]).getGuildTagBadgeUrl(pendingPrimaryGuildId, badge, GuildTagBadgeSize.SIZE_24);
const tmp6Result = tmp6(tmp7[8]);
2026-08-26 06:04:24 +00:00
}
if (null != stateFromStores) {
let name = stateFromStores.name;
} else {
const intl = tmp6(tmp7[10]).intl;
const string = intl.string;
const t = tmp6(tmp7[10]).t;
if (tmp12) {
name = string(t.dtwqPR);
2026-07-20 16:05:17 +00:00
} else {
2026-08-26 06:04:24 +00:00
name = string(t.ECv270);
2026-07-20 16:05:17 +00:00
}
}
2026-08-26 06:04:24 +00:00
let combined = name;
if (null != tag) {
const _HermesInternal = HermesInternal;
combined = "" + name + ", " + tag;
}
let num = 4;
if (tmp6Result2.isAndroid()) {
2026-08-26 06:04:24 +00:00
num = 1;
}
const sum = tmp6(tmp7[12]).TextStyleSheet["text-md/semibold"].fontSize + num;
const obj4 = { label: null, buttonText: null, accessibilityValue: null, onPress: null, leading: null, trailing: null, disabled: null };
2026-08-26 06:04:24 +00:00
const intl2 = tmp6(tmp7[10]).intl;
obj4.label = intl2.string(tmp6(tmp7[10]).t["DUD+5n"]);
obj4.buttonText = name;
const obj5 = { text: combined };
obj4.accessibilityValue = obj5;
obj4.onPress = function onPress() {
ActionSheetActionCreatorsDefault.openLazy(asyncRequireImpl(14698, dependencyMap.paths), "UserPrimaryGuildListBottomSheet", { availableGuilds: userAvailableGuildsWithTags, selectedGuildId: pendingPrimaryGuildId, onSelectGuild: handleSelectPrimaryGuild });
2026-08-26 06:04:24 +00:00
};
let tmp23Result = null;
if (null != stateFromStores) {
const obj6 = { guild: stateFromStores, size: tmp6(tmp7[17]).GuildIconSizes.LARGE };
tmp23Result = tmp23(userAvailableGuildsWithTags(tmp7[17]), obj6);
2026-08-26 06:04:24 +00:00
const tmp26 = userAvailableGuildsWithTags(tmp7[17]);
}
obj4.leading = tmp23Result;
let tmp23Result2 = null;
2026-08-26 06:04:24 +00:00
if (null != tag) {
const obj7 = { containerStyles: null, textStyle: null, guildTag: null, guildBadge: null, badgeSize: null, textVariant: "text-md/semibold", textColor: "text-default" };
2026-08-26 06:04:24 +00:00
const items2 = [tmp.tag, tagStyle];
obj7.containerStyles = items2;
const obj8 = { lineHeight: sum };
obj7.textStyle = obj8;
obj7.guildTag = tag;
obj7.guildBadge = guildTagBadgeUrl;
obj7.badgeSize = GuildTagBadgeSize.SIZE_16;
tmp23Result2 = tmp23(tmp6(tmp7[18]).BaseGuildTagChiplet, obj7);
2026-08-26 06:04:24 +00:00
}
obj4.trailing = tmp23Result2;
obj4.disabled = disabled;
return jsx(tmp6(tmp7[13]).UserProfileEditFormButton, { label: null, buttonText: null, accessibilityValue: null, onPress: null, leading: null, trailing: null, disabled: null });
2026-07-20 16:05:17 +00:00
}
return null;
};