decord/alpha/source/modules/chat/native/ChatViewStickyHeader.tsx

83 lines
3.7 KiB
TypeScript
Raw Normal View History

// Module ID: 11113
// Function ID: 11114
// Name: ChatViewStickyHeader
// Dependencies: [32, 19, 11114, 21, 11115, 10627, 11118, 11119, 11134, 11140, 11164, 11166, 11170, 11173, 2]
2026-07-20 16:05:17 +00:00
// Module 11113 (ChatViewStickyHeader)
import useInappropriateConversationBannerForChannel from "useInappropriateConversationBannerForChannel" /* 10627 */;
import useStrangerDangerWarning from "useStrangerDangerWarning" /* 11115 */;
import useLikelyAtoWarning from "useLikelyAtoWarning" /* 11118 */;
import LikelyAtoWarningBannerDefault from "LikelyAtoWarningBanner" /* 11119 */;
import StrangerDangerWarningBannerDefault from "StrangerDangerWarningBanner" /* 11134 */;
import InappropriateConversationWarningBannerDefault from "InappropriateConversationWarningBanner" /* 11140 */;
import useUnreadSettingNoticeDefault from "useUnreadSettingNotice" /* 11164 */;
import ChatBannerDefault from "ChatBanner" /* 11173 */;
import _slicedToArray from "module_32" /* 32 */;
import noop from "module_19" /* 19 */;
2026-07-23 10:11:24 +00:00
require = fn;
2026-07-20 16:05:17 +00:00
function ChatViewStickyHeaderAccountSafetyWarnings(arg0) {
({ channelId, senderId } = arg0);
const strangerDangerWarning = useStrangerDangerWarning.useStrangerDangerWarning(channelId);
const inappropriateConversationBannerForChannel = useInappropriateConversationBannerForChannel.useInappropriateConversationBannerForChannel(channelId, LOCATION_CONTEXT_MOBILE);
2026-08-24 06:08:38 +00:00
const likelyAtoWarning = useLikelyAtoWarning.useLikelyAtoWarning(channelId);
2026-07-20 16:05:17 +00:00
if (null != likelyAtoWarning) {
const obj4 = { channelId, warningId: likelyAtoWarning.id, senderId };
let tmp5 = timestampProducer(LikelyAtoWarningBannerDefault, obj4);
2026-07-20 16:05:17 +00:00
} else if (null != strangerDangerWarning) {
const obj5 = { channelId, warningId: strangerDangerWarning.id, senderId };
tmp5 = timestampProducer(StrangerDangerWarningBannerDefault, obj5);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
tmp5 = null;
2026-07-20 16:05:17 +00:00
if (null != inappropriateConversationBannerForChannel) {
const obj6 = { channelId, warningId: inappropriateConversationBannerForChannel.id, senderId };
tmp5 = timestampProducer(InappropriateConversationWarningBannerDefault, obj6);
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
return tmp5;
2026-07-20 16:05:17 +00:00
}
const LOCATION_CONTEXT_MOBILE = fn(11114).LOCATION_CONTEXT_MOBILE;
const jsxProd = fn(21);
({ jsx: metroRequire, Fragment: closure_7, jsxs: closure_8 } = jsxProd);
const size = fn(2);
const result = size.fileFinishedImporting("modules/chat/native/ChatViewStickyHeader.tsx");
export default noop.memo(noop.forwardRef((handleScrollToNewMessages, ref) => {
2026-07-20 16:05:17 +00:00
const channel = handleScrollToNewMessages.channel;
const tmp = _slicedToArray(noop.useState(false), 2);
closure_1 = tmp[1];
2026-08-24 06:08:38 +00:00
({ showUnreadsNotice, clearUnreadsNotice } = useUnreadSettingNoticeDefault(channel));
const imperativeHandle = noop.useImperativeHandle(ref, () => ({
2026-07-20 16:05:17 +00:00
onChatViewScrolled(isFirstMessageVisible) {
2026-07-29 08:29:29 +00:00
if (forumPost.isForumPost()) {
closure_1_1(!isFirstMessageVisible.isFirstMessageVisible);
2026-07-20 16:05:17 +00:00
}
}
}));
2026-07-29 08:29:29 +00:00
let tmp8 = null;
2026-07-20 16:05:17 +00:00
if (channel.isForumPost()) {
2026-07-29 08:29:29 +00:00
tmp8 = null;
2026-07-20 16:05:17 +00:00
if (tmp[0]) {
const obj = { channel };
tmp8 = timestampProducer(tmp2(11166), obj);
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
const items = [tmp8, , , ];
2026-07-20 16:05:17 +00:00
let tmp10 = null;
if (channel.isDM()) {
const obj2 = { channelId: channel.id, senderId: channel.getRecipientId() };
tmp10 = timestampProducer(ChatViewStickyHeaderAccountSafetyWarnings, obj2);
2026-07-20 16:05:17 +00:00
}
items[1] = tmp10;
let tmp13 = null;
if (showUnreadsNotice) {
const obj3 = { channel, clearUnreadsNotice };
tmp13 = timestampProducer(tmp2(11170), obj3);
2026-07-20 16:05:17 +00:00
}
const obj4 = { children: null };
2026-07-20 16:05:17 +00:00
items[2] = tmp13;
items[3] = timestampProducer(ChatBannerDefault, { channel, handleScrollToNewMessages: handleScrollToNewMessages.scrollToNewMessages });
obj4.children = items;
return React6(React5, obj4);
2026-07-20 16:05:17 +00:00
}));