// Module ID: 16809 // Function ID: 16810 // Name: renderChannelItem // Dependencies: [19, 17, 1980, 4288, 1372, 4821, 21, 9902, 1115, 4639, 576, 16810, 504, 5669, 12325, 7746, 16811, 11046, 16813, 4792, 2] // Exports: default, getChannelAccessibilityProps // Module 16809 (renderChannelItem) import nativeDefault from "native" /* 576 */; import util from "util" /* 1115 */; import useChannelName from "useChannelName" /* 4792 */; import GuildIconDefault from "GuildIcon" /* 5669 */; import NotificationCenterUtils from "NotificationCenterUtils" /* 7746 */; import getChannelA11yLabelDefault from "getChannelA11yLabel" /* 9902 */; import getLayoutStylesDefault from "getLayoutStyles" /* 16810 */; import renderChannelWrapperDefault from "renderChannelWrapper" /* 16811 */; import renderChannelContentDefault from "renderChannelContent" /* 16813 */; import noop from "module_19" /* 19 */; import GuildStore from "GuildStore" /* 1980 */; import RelationshipStore from "RelationshipStore" /* 4288 */; import UserStore from "UserStore" /* 1372 */; require = fn; function LaunchpadChannelIcon(channel) { channel = channel.channel; const tmp = closure_11(); const tmp2 = getLayoutStylesDefault(); const items = [GuildStore]; const obj2 = { children: null }; const obj3 = { style: tmp.guildBadgeIcon, children: null }; const stateFromStores = channel(504).useStateFromStores(items, () => GuildStore.getGuild(channel.guild_id)); obj3.children = closure_8(GuildIconDefault, { guild: stateFromStores, size: tmp2.icon.guildBadgeIconSize }); const items1 = [closure_8(View, obj3), closure_8(channel(12325).ChannelIcon, { channel, size: "sm", wrapperSize: 32 })]; obj2.children = items1; return closure_10(closure_9, obj2); } const View = fn(17).View; const UnreadSetting = fn(4821).UnreadSetting; const jsxProd = fn(21); ({ jsx: closure_8, Fragment: closure_9, jsxs: c10 } = jsxProd); const createStyles = fn(4639); let closure_11 = createStyles.createStyles(() => { const obj = { guildBadgeIcon: null }; const rect = { position: "absolute", zIndex: 1, bottom: -4, right: -4, borderColor: nativeDefault.colors.BACKGROUND_BASE_LOW, borderWidth: 2, borderRadius: 6 }; obj.guildBadgeIcon = rect; return obj; }); let size = fn(2); const result = size.fileFinishedImporting("modules/launchpad/native/shared/renderChannelItem.tsx"); export default function renderChannelItem(unread) { ({ 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) { relativeTimestamp = NotificationCenterUtils.getRelativeTimestamp(latestMessageTimestamp); } } const tmp7 = getLayoutStylesDefault(); const children = [unreadBadge, , , ]; const obj2 = { style: null, children: null }; const size = { position: "relative", borderRadius: nativeDefault.radii.round, justifyContent: "center", alignItems: "center", flexShrink: 0, flexGrow: 0, width: tmp7.icon.wrapper.size, height: tmp7.icon.wrapper.size }; const merged = Object.assign(tmp7.icon.margin); obj2.style = size; if (channel.isGroupDM()) { const obj3 = { channel, size: tmp7.icon.avatarSize }; let tmp11Result = tmp11(tmp5(11046), obj3); } else { const obj4 = { channel }; tmp11Result = tmp11(LaunchpadChannelIcon, obj4); } obj2.children = tmp11Result; children[1] = React6(View, obj2); const tmp10 = React7; const tmp8 = renderChannelWrapperDefault; const tmp9 = closure_1_10; if (channelName == null) { channelName = useChannelName.computeChannelName(channel, UserStore, RelationshipStore); } children[2] = renderChannelContentDefault({ name: channelName, subtitle, unread: flag, resolvedUnreadSetting: ONLY_MENTIONS, muted: flag3, lastMessageTimestampString: relativeTimestamp, channel, channelCategoryName, locked, connected, live: flag2, mentionCount, mentionBadge, isSubscriptionGated, needSubscriptionToAccess: flag4 }); let tmp11Result2 = null; if (null != end) { const obj5 = { style: { paddingLeft: 8 }, children: end }; tmp11Result2 = tmp11(tmp12, obj5); } children[3] = tmp11Result2; return tmp8(tmp9(tmp10, { children }), { fontScale }); }; export const getChannelAccessibilityProps = function getChannelAccessibilityProps(channel) { channel = channel.channel; const obj = { accessible: true, accessibilityRole: "button", accessibilityLabel: getChannelA11yLabelDefault({ channel, unread, mentionCount, voiceStates, embeddedActivitiesCount }), accessibilityHint: null }; ({ unread, mentionCount, voiceStates, embeddedActivitiesCount } = channel); if (channel.isGuildVoice()) { const intl = util.intl; const stringResult = intl.string(util.t["9C444m"]); } obj.accessibilityHint = stringResult; return obj; };