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

85 lines
3.6 KiB
TypeScript
Raw Normal View History

2026-07-27 11:26:19 +00:00
// Module ID: 15743
// Function ID: 121390
2026-07-20 16:05:17 +00:00
// Name: usePrivateChannelPressEvents
2026-07-27 11:26:19 +00:00
// Dependencies: [31, 4327, 33, 4139, 9029, 4131, 689, 15729, 14931, 14268, 21, 4550, 15730, 4661, 15742, 15733, 10220, 3809, 4321, 2]
2026-07-20 16:05:17 +00:00
2026-07-27 11:26:19 +00:00
// Module 15743 (usePrivateChannelPressEvents)
2026-07-23 10:11:24 +00:00
import importAllResult from "result";
import { UnreadSetting } from "ReadStateTypes";
import { jsx } from "jsxProd";
import _createForOfIteratorHelperLoose from "_createForOfIteratorHelperLoose";
const require = arg1;
2026-07-20 16:05:17 +00:00
function usePrivateChannelPressEvents(channel, flag) {
2026-07-23 10:11:24 +00:00
let closure_0 = channel;
let closure_1 = flag;
2026-07-20 16:05:17 +00:00
const items = [channel.id, flag];
const items1 = [channel.id];
return {
onPress: importAllResult.useCallback(() => {
2026-07-23 10:11:24 +00:00
let obj = channel(outer1_2[3]);
obj = { navigationReplace: closure_1 };
obj.transitionToChannel(channel.id, obj);
2026-07-20 16:05:17 +00:00
}, items),
2026-07-23 10:11:24 +00:00
onLongPress: importAllResult.useCallback(() => channel(outer1_2[4]).openChannelLongPressActionSheet(channel.id), items1)
2026-07-20 16:05:17 +00:00
};
}
let obj = { pressable: { flex: 1 } };
2026-07-23 10:11:24 +00:00
obj = { backgroundColor: require("_createForOfIteratorHelperLoose").colors.INTERACTIVE_BACKGROUND_ACTIVE };
2026-07-20 16:05:17 +00:00
obj.pressableUnderlayColor = obj;
2026-07-23 10:11:24 +00:00
let closure_6 = _createForOfIteratorHelperLoose.createStyles(obj);
2026-07-22 07:54:56 +00:00
const memoResult = importAllResult.memo(function DMChannel(navigationReplace) {
2026-07-20 16:05:17 +00:00
let channel;
let muted;
({ channel, muted } = navigationReplace);
if (muted === undefined) {
muted = false;
}
let flag = navigationReplace.navigationReplace;
if (flag === undefined) {
flag = false;
}
const tmp = callback();
2026-07-27 11:26:19 +00:00
let obj = require(14931) /* useBaseChannelUnreadBadgeState */;
2026-07-20 16:05:17 +00:00
const baseChannelUnreadBadgeState = obj.useBaseChannelUnreadBadgeState(channel, muted);
const unread = baseChannelUnreadBadgeState.unread;
2026-07-27 11:26:19 +00:00
const tmp4 = importDefault(14268)(channel, { unread });
2026-07-20 16:05:17 +00:00
let extractTimestampResult;
if (null != tmp4) {
2026-07-23 10:11:24 +00:00
let obj1 = importDefault(21);
2026-07-20 16:05:17 +00:00
extractTimestampResult = obj1.extractTimestamp(tmp4.id);
}
let str = "text-muted";
if (unread) {
str = "text-muted";
if (!muted) {
str = "text-default";
}
}
2026-07-25 08:10:48 +00:00
let obj2 = require(4550) /* getFontScale */;
2026-07-20 16:05:17 +00:00
const fontScale = obj2.useFontScale();
2026-07-27 11:26:19 +00:00
const tmp2 = importDefault(15729)();
2026-07-20 16:05:17 +00:00
obj = { style: items, underlayColor: tmp.pressableUnderlayColor.backgroundColor };
2026-07-23 10:11:24 +00:00
items = [tmp.pressable, { borderRadius: tmp2.container.borderRadius }];
2026-07-20 16:05:17 +00:00
const merged = Object.assign(usePrivateChannelPressEvents(channel, flag));
obj = { channel, unread, resolvedUnreadSetting: UnreadSetting.ALL_MESSAGES, muted, mentionCount: baseChannelUnreadBadgeState.mentionCount };
const tmp10 = jsx;
2026-07-27 11:26:19 +00:00
const tmp9 = importDefault(15730);
2026-07-20 16:05:17 +00:00
obj1 = { unread, resolvedUnreadSetting: UnreadSetting.ALL_MESSAGES, muted };
2026-07-27 11:26:19 +00:00
obj.unreadBadge = jsx(importDefault(15733), { unread, resolvedUnreadSetting: UnreadSetting.ALL_MESSAGES, muted });
2026-07-20 16:05:17 +00:00
let tmp13 = null != tmp4;
if (tmp13) {
2026-07-25 08:10:48 +00:00
obj2 = { channel, message: tmp4, color: str, muted, layout: require(3809) /* ChannelListLayoutTypes */.ChannelListLayoutTypes.COMPACT };
2026-07-27 11:26:19 +00:00
tmp13 = jsx(require(10220) /* PreviewIcon */.ChannelRowPreview, { channel, message: tmp4, color: str, muted, layout: require(3809) /* ChannelListLayoutTypes */.ChannelListLayoutTypes.COMPACT });
2026-07-20 16:05:17 +00:00
}
obj.subtitle = tmp13;
obj.latestMessageTimestamp = extractTimestampResult;
2026-07-25 08:10:48 +00:00
obj.channelName = importDefault(4321)(channel);
2026-07-20 16:05:17 +00:00
obj.fontScale = fontScale;
2026-07-27 11:26:19 +00:00
obj["children"] = importDefault(15742)(obj);
2026-07-25 08:10:48 +00:00
return tmp9(tmp10(require(4661) /* PressableBase */.PressableHighlight, obj));
2026-07-20 16:05:17 +00:00
});
2026-07-23 10:11:24 +00:00
const result = require("jsxProd").fileFinishedImporting("modules/launchpad/native/shared/DMChannel.tsx");
2026-07-22 07:54:56 +00:00
export default memoResult;