// Module ID: 15782 // Function ID: 121546 // Name: usePrivateChannelPressEvents // Dependencies: [31, 4361, 33, 4173, 9073, 4165, 689, 15768, 14975, 14312, 21, 4584, 15769, 4695, 15781, 15772, 10260, 3843, 4355, 2] // Module 15782 (usePrivateChannelPressEvents) import importAllResult from "result"; import { UnreadSetting } from "ReadStateTypes"; import { jsx } from "jsxProd"; import _createForOfIteratorHelperLoose from "_createForOfIteratorHelperLoose"; const require = arg1; function usePrivateChannelPressEvents(channel, flag) { let closure_0 = channel; let closure_1 = flag; const items = [channel.id, flag]; const items1 = [channel.id]; return { onPress: importAllResult.useCallback(() => { let obj = channel(outer1_2[3]); obj = { navigationReplace: closure_1 }; obj.transitionToChannel(channel.id, obj); }, items), onLongPress: importAllResult.useCallback(() => channel(outer1_2[4]).openChannelLongPressActionSheet(channel.id), items1) }; } let obj = { pressable: { flex: 1 } }; obj = { backgroundColor: require("_createForOfIteratorHelperLoose").colors.INTERACTIVE_BACKGROUND_ACTIVE }; obj.pressableUnderlayColor = obj; let closure_6 = _createForOfIteratorHelperLoose.createStyles(obj); const memoResult = importAllResult.memo(function DMChannel(navigationReplace) { let channel; let muted; ({ channel, muted } = navigationReplace); if (muted === undefined) { muted = false; } let flag = navigationReplace.navigationReplace; if (flag === undefined) { flag = false; } const tmp = callback(); let obj = require(14975) /* useBaseChannelUnreadBadgeState */; const baseChannelUnreadBadgeState = obj.useBaseChannelUnreadBadgeState(channel, muted); const unread = baseChannelUnreadBadgeState.unread; const tmp4 = importDefault(14312)(channel, { unread }); let extractTimestampResult; if (null != tmp4) { let obj1 = importDefault(21); extractTimestampResult = obj1.extractTimestamp(tmp4.id); } let str = "text-muted"; if (unread) { str = "text-muted"; if (!muted) { str = "text-default"; } } let obj2 = require(4584) /* getFontScale */; const fontScale = obj2.useFontScale(); const tmp2 = importDefault(15768)(); obj = { style: items, underlayColor: tmp.pressableUnderlayColor.backgroundColor }; items = [tmp.pressable, { borderRadius: tmp2.container.borderRadius }]; const merged = Object.assign(usePrivateChannelPressEvents(channel, flag)); obj = { channel, unread, resolvedUnreadSetting: UnreadSetting.ALL_MESSAGES, muted, mentionCount: baseChannelUnreadBadgeState.mentionCount }; const tmp10 = jsx; const tmp9 = importDefault(15769); obj1 = { unread, resolvedUnreadSetting: UnreadSetting.ALL_MESSAGES, muted }; obj.unreadBadge = jsx(importDefault(15772), { unread, resolvedUnreadSetting: UnreadSetting.ALL_MESSAGES, muted }); let tmp13 = null != tmp4; if (tmp13) { obj2 = { channel, message: tmp4, color: str, muted, layout: require(3843) /* ChannelListLayoutTypes */.ChannelListLayoutTypes.COMPACT }; tmp13 = jsx(require(10260) /* PreviewIcon */.ChannelRowPreview, { channel, message: tmp4, color: str, muted, layout: require(3843) /* ChannelListLayoutTypes */.ChannelListLayoutTypes.COMPACT }); } obj.subtitle = tmp13; obj.latestMessageTimestamp = extractTimestampResult; obj.channelName = importDefault(4355)(channel); obj.fontScale = fontScale; obj["children"] = importDefault(15781)(obj); return tmp9(tmp10(require(4695) /* PressableBase */.PressableHighlight, obj)); }); const result = require("jsxProd").fileFinishedImporting("modules/launchpad/native/shared/DMChannel.tsx"); export default memoResult;