Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4791.js (118.4 MB)
123 lines
4.7 KiB
TypeScript
123 lines
4.7 KiB
TypeScript
// Module ID: 16414
|
|
// Function ID: 16415
|
|
// Name: HomeDrawerDM
|
|
// Dependencies: [19, 17, 1961, 4255, 4787, 1371, 1085, 21, 4606, 504, 4759, 16415, 15380, 13386, 9149, 4602, 10198, 7953, 16377, 4470, 4467, 2]
|
|
// Exports: default
|
|
|
|
// Module 16414 (HomeDrawerDM)
|
|
import HomeDrawerExperiment from "HomeDrawerExperiment" /* 4470 */;
|
|
import Text_Text from "Text/Text" /* 4602 */;
|
|
import useChannelName from "useChannelName" /* 4759 */;
|
|
import ChannelListLayoutTypes from "ChannelListLayoutTypes" /* 7953 */;
|
|
import ChannelRowPreview from "ChannelRowPreview" /* 10198 */;
|
|
import useMessagePreviewsDefault from "useMessagePreviews" /* 15380 */;
|
|
import noop from "module_19" /* 19 */;
|
|
import RelationshipStore from "RelationshipStore" /* 4255 */;
|
|
import UserGuildSettingsStore from "UserGuildSettingsStore" /* 4787 */;
|
|
import UserStore from "UserStore" /* 1371 */;
|
|
|
|
require = fn;
|
|
function HomeDrawerDMExpandedChildren(channel) {
|
|
channel = channel.channel;
|
|
let memo;
|
|
const tmp = closure_12();
|
|
importDefault = tmp;
|
|
let items = [UserStore];
|
|
dependencyMap = channel(504).useStateFromStores(items, () => UserStore.getUser(channel.getRecipientId()));
|
|
let obj = channel(504);
|
|
const items1 = [UserStore, memo];
|
|
const stateFromStores = channel(504).useStateFromStores(items1, () => {
|
|
let tmp2 = null;
|
|
if (null != channel) {
|
|
if (isMultiUserDM(tmp.type)) {
|
|
let channelName = useChannelName.computeChannelName(tmp, UserStore, RelationshipStore);
|
|
} else {
|
|
channelName = null;
|
|
}
|
|
tmp2 = channelName;
|
|
}
|
|
return tmp2;
|
|
});
|
|
let obj2 = channel(504);
|
|
const tmp3 = useMessagePreviewsDefault(channel, { unread: channel(16415).useBaseChannelUnreadBadgeState(channel, false).unread });
|
|
closure_4 = tmp3;
|
|
const obj3 = channel(16415);
|
|
const items2 = [UserGuildSettingsStore];
|
|
const stateFromStores1 = channel(504).useStateFromStores(items2, () => UserGuildSettingsStore.getChannelMuteConfig(channel.guild_id, channel.id));
|
|
const items3 = [stateFromStores1];
|
|
memo = stateFromStores.useMemo(() => {
|
|
if (null == stateFromStores1) {
|
|
let obj = { isMuted: false, isTemporary: false };
|
|
} else {
|
|
let tmp2 = null == tmp.end_time;
|
|
if (!tmp2) {
|
|
const _Date = Date;
|
|
const date = new Date(tmp.end_time);
|
|
const _Date2 = Date;
|
|
const date1 = new Date();
|
|
tmp2 = date > date1;
|
|
}
|
|
obj = { isMuted: tmp2, isTemporary: null != tmp.end_time };
|
|
}
|
|
return obj;
|
|
}, items3);
|
|
const items4 = [stateFromStores, memo, , ];
|
|
({ title: arr5[2], titleText: arr5[3] } = tmp);
|
|
const items5 = [channel, tmp3, memo];
|
|
const title = stateFromStores.useMemo(() => {
|
|
let isMuted;
|
|
if (memo != null) {
|
|
isMuted = tmp.isMuted;
|
|
}
|
|
if (isMuted) {
|
|
let isTemporary;
|
|
if (tmp != null) {
|
|
isTemporary = tmp.isTemporary;
|
|
}
|
|
let tmp5Result = dependencyMap;
|
|
if (isTemporary) {
|
|
tmp5Result = tmp5(13386);
|
|
let BellSlashIcon = tmp5Result.BellZIcon;
|
|
} else {
|
|
BellSlashIcon = tmp5(9149).BellSlashIcon;
|
|
}
|
|
} else {
|
|
const obj = { style: closure_1.title, children: null };
|
|
const obj2 = { variant: "text-md/medium", style: closure_1.titleText, lineClamp: 1, color: "text-default", children: stateFromStores };
|
|
const items = [closure_2_10(Text_Text.Text, obj2), closure_2_10(NOOP, { size: "xs" })];
|
|
obj.children = items;
|
|
return closure_2_11(View, obj);
|
|
}
|
|
}, items4);
|
|
const subtitle = stateFromStores.useMemo(() => {
|
|
let tmp2 = null;
|
|
if (null != closure_4) {
|
|
const obj = { channel, message: tmp, variant: "text-xs/medium", color: "text-strong", layout: ChannelListLayoutTypes.ChannelListLayoutTypes.COZY, muted: memo.isMuted };
|
|
tmp2 = closure_2_10(ChannelRowPreview.ChannelRowPreview, obj);
|
|
}
|
|
return tmp2;
|
|
}, items5);
|
|
return closure_10(channel(16377).HomeDrawerSharedItem, { title, subtitle });
|
|
}
|
|
const View = fn(17).View;
|
|
const isMultiUserDM = fn(1961).isMultiUserDM;
|
|
const NOOP = fn(1085).NOOP;
|
|
const jsxProd = fn(21);
|
|
({ jsx: c10, jsxs: closure_11 } = jsxProd);
|
|
const createStyles = fn(4606);
|
|
let closure_12 = createStyles.createStyles({ title: { flexDirection: "row", alignItems: "center", gap: 4 }, titleText: { flexShrink: 1 } });
|
|
const size = fn(2);
|
|
const result = size.fileFinishedImporting("modules/home_drawer/native/HomeDrawerDM.tsx");
|
|
|
|
export default function HomeDrawerDMExpandedChildrenWrapper(channel) {
|
|
const MobileHomeDrawerExperiment = HomeDrawerExperiment.MobileHomeDrawerExperiment;
|
|
let tmp2 = null;
|
|
if (MobileHomeDrawerExperiment.useConfig({ location: "dm-expanded-children" }).enableHome) {
|
|
tmp2 = null;
|
|
if (!tmp) {
|
|
const obj = { channel: channel.channel };
|
|
tmp2 = closure_1_10(HomeDrawerDMExpandedChildren, obj);
|
|
}
|
|
}
|
|
return tmp2;
|
|
};
|