decord/source/modules/user_profile/native/UserProfileActivityVoiceChannel.tsx
2026-07-30 10:14:41 +00:00

170 lines
6.7 KiB
TypeScript

// Module ID: 12011
// Function ID: 12012
// Name: UserProfileActivityVoiceChannel
// Dependencies: [17, 3817, 505, 21, 4189, 500, 5515, 8104, 4586, 12012, 4380, 589, 4711, 4715, 1236, 5566, 4717, 3890, 5565, 4185, 8313, 4399, 4157, 12013, 1959, 8356, 12014, 1297, 2]
// Exports: default
// Module 12011 (UserProfileActivityVoiceChannel)
import { View } from "dispatcher";
import getUncachedChannelPermissions from "getUncachedChannelPermissions";
import { Permissions } from "sum";
import jsxProd from "openChannelCallModal";
import createCacheKey from "createCacheKey";
import set from "set";
import set from "sum";
let closure_6;
let error;
({ jsx: closure_6, jsxs: error } = jsxProd);
let obj = { container: { flexDirection: "row", alignItems: "center", gap: 4, overflow: "hidden" }, channelButton: { flex: 1, flexDirection: "row", alignItems: "center", gap: 2 }, channelName: null };
let num = -1;
if (set.isAndroid()) {
num = -2;
}
obj[2] = { flex: 1, overflow: "hidden", marginTop: num };
let closure_8 = createCacheKey.createStyles(obj);
const result = set.fileFinishedImporting("modules/user_profile/native/UserProfileActivityVoiceChannel.tsx");
export default function UserProfileActivityVoiceChannel(guild) {
guild = guild.guild;
const channel = guild.channel;
const onAction = guild.onAction;
let newestAnalyticsLocation;
let context;
let arr;
const tmp = callback();
newestAnalyticsLocation = channel(onAction[6])().newestAnalyticsLocation;
let obj = guild(onAction[7]);
context = obj.useUserProfileAnalyticsContext().context;
let obj1 = guild(onAction[8]);
const isScreenReaderEnabled = obj1.useIsScreenReaderEnabled();
arr = channel(onAction[9])(channel);
const tmp6 = channel(onAction[10])(channel);
let obj2 = guild(onAction[11]);
const items = [context];
const stateFromStores = obj2.useStateFromStores(items, () => {
let isPrivateResult = channel.isPrivate();
if (!isPrivateResult) {
isPrivateResult = context.can(arr.CONNECT, channel);
}
return isPrivateResult;
});
if (channel.isGuildStageVoice()) {
let VoiceNormalIcon = tmp4(tmp3[12]).StageIcon;
} else {
VoiceNormalIcon = tmp4(tmp3[13]).VoiceNormalIcon;
}
obj = { style: items1, children: null };
items1 = [tmp.container, guild.style];
if (isScreenReaderEnabled) {
obj = { accessible: true, accessibilityLabel: null, children: null };
const intl = tmp4(tmp3[14]).intl;
obj1 = { guildName: null };
obj1[0] = guild.name;
obj[1] = intl.formatToPlainString(tmp4(tmp3[14]).t.xm6W9D, obj1);
obj2 = { size: null, guild: null };
let tmp2Result = tmp2(tmp3[15]);
obj2[0] = tmp4(tmp3[15]).GuildIconSizes.XXSMALL;
obj2[1] = guild;
obj[2] = tmp10(tmp2Result, obj2);
let tmp10Result = tmp10(tmp9, obj);
let tmp13 = tmp10;
} else {
const obj3 = { accessibilityRole: "button", accessibilityLabel: null, onPress: null, children: null };
obj3[1] = guild.name;
obj3[2] = function onPress() {
onAction({ action: "PRESS_VOICE_CHANNEL_ICON" });
let obj = channel(onAction[17]);
obj = {
key: "GUILD_NAME_TOAST",
content: guild.name,
icon() {
const obj = { size: null, guild: null };
obj[0] = outer1_0(outer1_2[15]).GuildIconSizes.XSMALL;
obj[1] = closure_0;
return outer1_6(outer1_1(outer1_2[15]), obj);
}
};
obj.open(obj);
};
const obj4 = { size: null, guild: null };
tmp2Result = tmp2(tmp3[15]);
obj4[0] = tmp4(tmp3[15]).GuildIconSizes.XXSMALL;
obj4[1] = guild;
obj3[3] = tmp10(tmp2Result, obj4);
tmp10Result = tmp10(tmp4(tmp3[16]).PressableOpacity, obj3);
tmp13 = tmp10;
}
const items2 = [tmp10Result, tmp13(guild(onAction[18]).ChevronSmallRightIcon, { size: "xxs", color: "text-default" }), , ];
if (stateFromStores) {
const obj5 = { style: null, accessibilityRole: "button", accessibilityLabel: null, accessibilityHint: null, onPress: null, children: null };
obj5[0] = tmp.channelButton;
const obj6 = { channel: null };
obj6[0] = channel;
obj5[2] = tmp2(tmp3[20])(obj6);
const intl2 = tmp4(tmp3[14]).intl;
obj5[3] = intl2.string(tmp4(tmp3[14]).t["9C444m"]);
obj5[4] = function onPress() {
onAction({ action: "OPEN_VOICE_CHANNEL" });
guild(onAction[21]).openGuildVoiceModal(channel, newestAnalyticsLocation);
const obj = guild(onAction[21]);
channel(onAction[22]).hideActionSheet();
};
const items3 = [tmp13(VoiceNormalIcon, { size: "xxs", color: "text-default" }), ];
const obj7 = { style: null, variant: "text-xs/normal", lineClamp: 1, children: null };
obj7[0] = tmp.channelName;
obj7[3] = tmp6;
items3[1] = tmp13(tmp4(tmp3[19]).Text, obj7);
obj5[5] = items3;
let tmp8Result = tmp8(tmp4(tmp3[16]).PressableOpacity, obj5);
} else {
const obj8 = { style: null, children: null };
obj8[0] = tmp.channelButton;
const items4 = [tmp13(VoiceNormalIcon, { size: "xxs", color: "text-default" }), ];
const obj9 = { style: null, variant: "text-xs/normal", lineClamp: 1, children: null };
obj9[0] = tmp.channelName;
obj9[3] = tmp6;
items4[1] = tmp13(tmp4(tmp3[19]).Text, obj9);
obj8[1] = items4;
tmp8Result = tmp8(tmp9, obj8);
}
items2[2] = tmp8Result;
const obj10 = { accessibilityRole: "button", accessibilityLabel: null, onPress: null, children: null };
const intl3 = tmp4(tmp3[14]).intl;
obj10[1] = intl3.formatToPlainString(guild(onAction[14]).t.e95u3C, { count: arr.length });
obj10[2] = function onPress() {
onAction({ action: "PRESS_VOICE_CHANNEL_AVATARS" });
let obj = channel(onAction[22]);
obj = {
users: arr,
channel,
onPressUser(userId) {
const obj = {};
const merged = Object.assign(getUncachedChannelPermissions);
obj.userId = userId;
return outer1_1(outer1_2[25])(obj);
}
};
obj.openLazy(guild(onAction[24])(onAction[23], onAction.paths), "UserProfileActivityVoiceChannelUsers", obj, "stack");
};
const obj12 = { size: null, totalCount: null, names: null, children: null };
obj12[0] = guild(onAction[27]).AvatarSizes.SIZE_16;
obj12[1] = arr.length;
obj12[2] = arr.map((username) => username.username);
let substr = arr;
if (arr.length > 3) {
substr = arr.slice(0, 3);
}
obj12[3] = substr.map((id) => {
const obj = { size: null, channel: null, guildId: null, user: null };
obj[0] = guild(onAction[27]).AvatarSizes.SIZE_16;
obj[1] = channel;
obj[2] = guild.id;
obj[3] = id;
return outer1_6(guild(onAction[27]).Avatar, obj, id.id);
});
obj10[3] = tmp13(guild(onAction[26]).AvatarPile, obj12);
items2[3] = tmp13(guild(onAction[16]).PressableOpacity, obj10);
obj[1] = items2;
return closure_7(newestAnalyticsLocation, obj);
};