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

101 lines
4.2 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 10405
// Function ID: 10406
2026-07-20 16:05:17 +00:00
// Name: ChatViewStickyHeaderAccountSafetyWarnings
2026-08-25 06:04:03 +00:00
// Dependencies: [32, 19, 10406, 21, 10407, 10412, 10416, 10417, 10432, 10438, 10462, 10464, 10468, 10471, 2]
2026-07-20 16:05:17 +00:00
2026-08-25 06:04:03 +00:00
// Module 10405 (ChatViewStickyHeaderAccountSafetyWarnings)
import useStrangerDangerWarning from "useStrangerDangerWarning" /* 10407 */;
import useInappropriateConversationBannerForChannel from "useInappropriateConversationBannerForChannel" /* 10412 */;
import useLikelyAtoWarning from "useLikelyAtoWarning" /* 10416 */;
import LikelyAtoWarningBannerDefault from "LikelyAtoWarningBanner" /* 10417 */;
import StrangerDangerWarningBannerDefault from "StrangerDangerWarningBanner" /* 10432 */;
import InappropriateConversationWarningBannerDefault from "InappropriateConversationWarningBanner" /* 10438 */;
import useUnreadSettingNoticeDefault from "useUnreadSettingNotice" /* 10462 */;
import OptInChannelBannerDefault from "OptInChannelBanner" /* 10471 */;
2026-08-24 06:08:38 +00:00
import closure_3 from "_slicedToArray" /* 32 */;
import importAllResult from "noop" /* 19 */;
2026-08-25 06:04:03 +00:00
import { LOCATION_CONTEXT_MOBILE } from "LOCATION_CONTEXT_MOBILE" /* 10406 */;
2026-08-24 06:08:38 +00:00
import jsxProd from "jsxProd" /* 21 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-07-20 16:05:17 +00:00
function ChatViewStickyHeaderAccountSafetyWarnings(arg0) {
({ channelId, senderId } = arg0);
2026-08-24 06:08:38 +00:00
let obj = useStrangerDangerWarning;
2026-07-20 16:05:17 +00:00
const strangerDangerWarning = obj.useStrangerDangerWarning(channelId);
2026-08-24 06:08:38 +00:00
obj1 = useInappropriateConversationBannerForChannel;
2026-07-20 16:05:17 +00:00
const inappropriateConversationBannerForChannel = obj1.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) {
2026-07-29 08:29:29 +00:00
obj = { channelId: null, warningId: null, senderId: null };
obj[0] = channelId;
obj[1] = likelyAtoWarning.id;
obj[2] = senderId;
2026-08-24 06:08:38 +00:00
let tmp5 = callback2(LikelyAtoWarningBannerDefault, obj);
2026-07-20 16:05:17 +00:00
} else if (null != strangerDangerWarning) {
2026-07-29 08:29:29 +00:00
obj = { channelId: null, warningId: null, senderId: null };
obj[0] = channelId;
obj[1] = strangerDangerWarning.id;
obj[2] = senderId;
2026-08-24 06:08:38 +00:00
tmp5 = callback2(StrangerDangerWarningBannerDefault, obj);
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) {
2026-07-29 08:29:29 +00:00
obj1 = { channelId: null, warningId: null, senderId: null };
obj1[0] = channelId;
obj1[1] = inappropriateConversationBannerForChannel.id;
obj1[2] = senderId;
2026-08-24 06:08:38 +00:00
tmp5 = callback2(InappropriateConversationWarningBannerDefault, obj1);
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
}
2026-07-29 08:29:29 +00:00
let c4 = importAllResult;
2026-08-24 06:08:38 +00:00
({ jsx: closure_6, Fragment: error, jsxs: closure_8 } = jsxProd);
2026-07-29 08:29:29 +00:00
const memoResult = importAllResult.memo(importAllResult.forwardRef((handleScrollToNewMessages, ref) => {
2026-07-20 16:05:17 +00:00
const channel = handleScrollToNewMessages.channel;
2026-08-24 06:08:38 +00:00
importDefault = undefined;
2026-07-20 16:05:17 +00:00
const tmp = callback(importAllResult.useState(false), 2);
2026-07-29 08:29:29 +00:00
importDefault = tmp[1];
2026-08-24 06:08:38 +00:00
({ showUnreadsNotice, clearUnreadsNotice } = useUnreadSettingNoticeDefault(channel));
2026-07-29 08:29:29 +00:00
const imperativeHandle = importAllResult.useImperativeHandle(ref, () => ({
2026-07-20 16:05:17 +00:00
onChatViewScrolled(isFirstMessageVisible) {
2026-07-29 08:29:29 +00:00
if (forumPost.isForumPost()) {
callback(!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]) {
2026-07-29 08:29:29 +00:00
let obj = { channel: null };
obj[0] = channel;
2026-08-25 06:04:03 +00:00
tmp8 = callback2(tmp2(10464), 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()) {
2026-07-29 08:29:29 +00:00
obj = { channelId: null, senderId: null };
obj[0] = channel.id;
obj[1] = channel.getRecipientId();
2026-07-20 16:05:17 +00:00
tmp10 = callback2(ChatViewStickyHeaderAccountSafetyWarnings, obj);
}
items[1] = tmp10;
let tmp13 = null;
if (showUnreadsNotice) {
2026-07-29 08:29:29 +00:00
obj = { channel: null, clearUnreadsNotice: null };
obj[0] = channel;
obj[1] = clearUnreadsNotice;
2026-08-25 06:04:03 +00:00
tmp13 = callback2(tmp2(10468), obj);
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
obj1 = { children: null };
2026-07-20 16:05:17 +00:00
items[2] = tmp13;
2026-08-24 06:08:38 +00:00
items[3] = callback2(OptInChannelBannerDefault, { channel, handleScrollToNewMessages: handleScrollToNewMessages.scrollToNewMessages });
2026-07-29 08:29:29 +00:00
obj1[0] = items;
return closure_8(closure_7, obj1);
2026-07-20 16:05:17 +00:00
}));
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/chat/native/ChatViewStickyHeader.tsx");
2026-07-20 16:05:17 +00:00
export default memoResult;