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

85 lines
3.6 KiB
TypeScript
Raw Normal View History

2026-07-23 10:11:24 +00:00
// Module ID: 15673
// Function ID: 120852
2026-07-20 16:05:17 +00:00
// Name: usePrivateChannelPressEvents
2026-07-23 10:11:24 +00:00
// Dependencies: [31, 4326, 33, 4138, 9099, 4130, 689, 15659, 14872, 14206, 21, 4549, 15660, 4660, 15672, 15663, 10255, 3808, 4320, 2]
2026-07-20 16:05:17 +00:00
2026-07-23 10:11:24 +00:00
// Module 15673 (usePrivateChannelPressEvents)
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-23 10:11:24 +00:00
let obj = require(14872) /* useBaseChannelUnreadBadgeState */;
2026-07-20 16:05:17 +00:00
const baseChannelUnreadBadgeState = obj.useBaseChannelUnreadBadgeState(channel, muted);
const unread = baseChannelUnreadBadgeState.unread;
2026-07-23 10:11:24 +00:00
const tmp4 = importDefault(14206)(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-23 10:11:24 +00:00
let obj2 = require(4549) /* getFontScale */;
2026-07-20 16:05:17 +00:00
const fontScale = obj2.useFontScale();
2026-07-23 10:11:24 +00:00
const tmp2 = importDefault(15659)();
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-23 10:11:24 +00:00
const tmp9 = importDefault(15660);
2026-07-20 16:05:17 +00:00
obj1 = { unread, resolvedUnreadSetting: UnreadSetting.ALL_MESSAGES, muted };
2026-07-23 10:11:24 +00:00
obj.unreadBadge = jsx(importDefault(15663), { unread, resolvedUnreadSetting: UnreadSetting.ALL_MESSAGES, muted });
2026-07-20 16:05:17 +00:00
let tmp13 = null != tmp4;
if (tmp13) {
2026-07-23 10:11:24 +00:00
obj2 = { channel, message: tmp4, color: str, muted, layout: require(3808) /* ChannelListLayoutTypes */.ChannelListLayoutTypes.COMPACT };
tmp13 = jsx(require(10255) /* PreviewIcon */.ChannelRowPreview, { channel, message: tmp4, color: str, muted, layout: require(3808) /* ChannelListLayoutTypes */.ChannelListLayoutTypes.COMPACT });
2026-07-20 16:05:17 +00:00
}
obj.subtitle = tmp13;
obj.latestMessageTimestamp = extractTimestampResult;
2026-07-23 10:11:24 +00:00
obj.channelName = importDefault(4320)(channel);
2026-07-20 16:05:17 +00:00
obj.fontScale = fontScale;
2026-07-23 10:11:24 +00:00
obj["children"] = importDefault(15672)(obj);
return tmp9(tmp10(require(4660) /* 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;