decord/source/modules/launchpad/native/shared/renderChannelItem.tsx

143 lines
5.3 KiB
TypeScript
Raw Normal View History

2026-08-10 06:55:34 +00:00
// Module ID: 16065
// Function ID: 16066
2026-07-20 16:05:17 +00:00
// Name: LaunchpadChannelIcon
2026-08-10 06:55:34 +00:00
// Dependencies: [19, 17, 1891, 3938, 1903, 4500, 21, 9033, 4303, 712, 16052, 589, 5779, 11576, 7102, 16054, 9663, 16057, 4494, 2]
2026-07-20 16:05:17 +00:00
// Exports: default, getChannelAccessibilityProps
2026-08-10 06:55:34 +00:00
// Module 16065 (LaunchpadChannelIcon)
2026-07-29 08:29:29 +00:00
import "set";
import { View } from "ChannelContent";
import createGuildRecordFromRust from "createGuildRecordFromRust";
import upsertRelationship from "upsertRelationship";
import mergeGuildAvatar from "mergeGuildAvatar";
2026-07-23 10:11:24 +00:00
import { UnreadSetting } from "ReadStateTypes";
import jsxProd from "jsxProd";
2026-07-29 08:29:29 +00:00
import createCacheKey from "createCacheKey";
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
let c10;
let c9;
let metroImportAll;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-20 16:05:17 +00:00
function LaunchpadChannelIcon(channel) {
channel = channel.channel;
const tmp = callback3();
2026-07-29 08:29:29 +00:00
let obj = channel(589);
const items = [createGuildRecordFromRust];
obj = { children: null };
obj = { style: tmp.guildBadgeIcon, children: null };
2026-07-23 10:11:24 +00:00
const stateFromStores = obj.useStateFromStores(items, () => outer1_4.getGuild(channel.guild_id));
2026-08-10 06:55:34 +00:00
const tmp2 = importDefault(16052)();
obj[1] = callback(importDefault(5779), { guild: stateFromStores, size: importDefault(16052)().icon.guildBadgeIconSize });
const items1 = [callback(View, obj), callback(channel(11576).ChannelIcon, { channel, size: "sm", wrapperSize: 32 })];
2026-07-29 08:29:29 +00:00
obj[0] = items1;
2026-07-20 16:05:17 +00:00
return callback2(closure_9, obj);
}
2026-07-29 08:29:29 +00:00
({ jsx: metroImportAll, Fragment: c9, jsxs: c10 } = jsxProd);
let closure_11 = createCacheKey.createStyles(() => {
let obj = { guildBadgeIcon: null };
obj = { position: "absolute", zIndex: 1, bottom: -4, right: -4, borderColor: importDefault(712).colors.BACKGROUND_BASE_LOW, borderWidth: 2, borderRadius: 6 };
obj[0] = obj;
2026-07-20 16:05:17 +00:00
return obj;
});
2026-07-29 08:29:29 +00:00
const result = require("createGuildRecordFromRust").fileFinishedImporting("modules/launchpad/native/shared/renderChannelItem.tsx");
2026-07-20 16:05:17 +00:00
export default function renderChannelItem(unread) {
let channel;
let channelCategoryName;
let channelName;
let connected;
let end;
let fontScale;
let isSubscriptionGated;
let latestMessageTimestamp;
let locked;
let mentionBadge;
let mentionCount;
let subtitle;
let unreadBadge;
({ channel, locked } = unread);
({ channelCategoryName, subtitle, unreadBadge, mentionBadge } = unread);
if (locked === undefined) {
locked = false;
}
let flag = unread.unread;
if (flag === undefined) {
flag = false;
}
let ONLY_MENTIONS = unread.resolvedUnreadSetting;
if (ONLY_MENTIONS === undefined) {
ONLY_MENTIONS = UnreadSetting.ONLY_MENTIONS;
}
let flag2 = unread.live;
if (flag2 === undefined) {
flag2 = false;
}
let flag3 = unread.muted;
if (flag3 === undefined) {
flag3 = false;
}
({ latestMessageTimestamp, end, channelName, isSubscriptionGated, connected, mentionCount, fontScale } = unread);
if (isSubscriptionGated === undefined) {
isSubscriptionGated = false;
}
let flag4 = unread.needSubscriptionToAccess;
if (flag4 === undefined) {
flag4 = false;
}
let relativeTimestamp = null;
if (null != latestMessageTimestamp) {
relativeTimestamp = null;
if (!flag3) {
2026-08-08 06:10:11 +00:00
let obj = require(7102) /* getRelativeTimestamp */;
2026-07-20 16:05:17 +00:00
relativeTimestamp = obj.getRelativeTimestamp(latestMessageTimestamp);
}
}
2026-08-10 06:55:34 +00:00
const tmp7 = importDefault(16052)();
2026-07-29 08:29:29 +00:00
const children = [unreadBadge, , , ];
obj = { style: null, children: null };
obj = { position: "relative", borderRadius: null, justifyContent: "center", alignItems: "center", flexShrink: 0, flexGrow: 0, width: null, height: null };
obj[1] = importDefault(712).radii.round;
obj[6] = tmp7.icon.wrapper.size;
obj[7] = tmp7.icon.wrapper.size;
const merged = Object.assign(tmp7.icon.margin);
obj[0] = obj;
2026-07-20 16:05:17 +00:00
if (channel.isGroupDM()) {
2026-07-29 08:29:29 +00:00
const obj1 = { channel: null, size: null };
obj1[0] = channel;
obj1[1] = tmp7.icon.avatarSize;
2026-08-08 06:10:11 +00:00
let tmp11Result = tmp11(tmp5(9663), obj1);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
const obj2 = { channel: null };
obj2[0] = channel;
tmp11Result = tmp11(LaunchpadChannelIcon, obj2);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[1] = tmp11Result;
children[1] = closure_8(View, obj);
const tmp10 = closure_9;
2026-08-10 06:55:34 +00:00
const tmp8 = importDefault(16054);
2026-07-29 08:29:29 +00:00
const tmp9 = closure_10;
if (channelName == null) {
2026-08-08 06:10:11 +00:00
channelName = require(4494) /* computeChannelName */.computeChannelName(channel, mergeGuildAvatar, upsertRelationship);
const obj6 = require(4494) /* computeChannelName */;
2026-07-20 16:05:17 +00:00
}
2026-08-10 06:55:34 +00:00
children[2] = importDefault(16057)({ name: channelName, subtitle, unread: flag, resolvedUnreadSetting: ONLY_MENTIONS, muted: flag3, lastMessageTimestampString: relativeTimestamp, channel, channelCategoryName, locked, connected, live: flag2, mentionCount, mentionBadge, isSubscriptionGated, needSubscriptionToAccess: flag4 });
2026-07-29 08:29:29 +00:00
tmp11Result = null;
2026-07-20 16:05:17 +00:00
if (null != end) {
2026-07-29 08:29:29 +00:00
const obj3 = { style: null, children: null };
obj3[0] = { paddingLeft: 8 };
obj3[1] = end;
tmp11Result = tmp11(tmp12, obj3);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
children[3] = tmp11Result;
return tmp8(tmp9(tmp10, { children }), { fontScale });
2026-07-20 16:05:17 +00:00
};
export const getChannelAccessibilityProps = function getChannelAccessibilityProps(arg0) {
let channel;
let embeddedActivitiesCount;
let mentionCount;
let unread;
let voiceStates;
({ channel, unread, mentionCount, voiceStates, embeddedActivitiesCount } = arg0);
2026-08-08 06:10:11 +00:00
return { accessible: true, accessibilityRole: "button", accessibilityLabel: importDefault(9033)({ channel, unread, mentionCount, voiceStates, embeddedActivitiesCount }) };
2026-07-20 16:05:17 +00:00
};