This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

@@ -0,0 +1,69 @@
// Metro module 15000 (f15001).
import { useMemo } from "react";
import { View } from "react-native";
import { isMultiUserDM } from "../../../records/ChannelRecord";
import RelationshipStore from "../../../stores/RelationshipStore";
import UserGuildSettingsStore from "../../../stores/UserGuildSettingsStore";
import UserStore from "../../../stores/UserStore";
import { NOOP } from "../../../_bundle/Module505";
import { jsx } from "react/jsx-runtime";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import { useStateFromStores } from "../../../_bundle/Module589";
import { computeChannelName } from "../../channel/useChannelName";
import { useBaseChannelUnreadBadgeState } from "../../launchpad/native/shared/useChannelUnreadBadgeState";
import useMessagePreviews from "../../main_tabs_v2/useMessagePreviews";
import { BellZIcon } from "../../../design/components/Icon/native/redesign/generated/BellZIcon";
import { BellSlashIcon } from "../../../design/components/Icon/native/redesign/generated/BellSlashIcon";
import { Text } from "../../../design/components/Text/native/Text";
import { ChannelRowPreview } from "../../main_tabs_v2/native/shared_components/ChannelRowPreview";
import { ChannelListLayoutTypes } from "../../main_tabs_v2/ChannelListLayoutTypes";
import { HomeDrawerSharedItem } from "./HomeDrawerShared";
import { MobileHomeDrawerExperiment } from "./HomeDrawerExperiment";
import useChatLayout from "../../chat/native/useChatLayout";
let useStyles;
const HomeDrawerDMExpandedChildren = function HomeDrawerDMExpandedChildren(props) {
let stateFromStores2, message, stateFromStores3, memo;
const channel = props.channel;
stateFromStores2 = void 0;
message = void 0;
stateFromStores3 = void 0;
memo = void 0;
const styles = useStyles();
const stateFromStores = useStateFromStores([UserStore], () => UserStore.getUser(channel.getRecipientId()));
stateFromStores2 = useStateFromStores([UserStore, RelationshipStore], () => channel == null ? null : isMultiUserDM(channel.type) ? computeChannelName(channel, UserStore, RelationshipStore) : stateFromStores != null ? computeChannelName(channel, UserStore, RelationshipStore) : null);
message = useMessagePreviews(channel, {
unread: useBaseChannelUnreadBadgeState(channel, false).unread
});
stateFromStores3 = useStateFromStores([UserGuildSettingsStore], () => UserGuildSettingsStore.getChannelMuteConfig(channel.guild_id, channel.id));
memo = useMemo(() => stateFromStores3 == null ? {
isMuted: false,
isTemporary: false
} : {
isMuted: stateFromStores3.end_time == null || new Date(stateFromStores3.end_time) > new Date(),
isTemporary: stateFromStores3.end_time != null
}, [stateFromStores3]);
return <HomeDrawerSharedItem title={useMemo(() => <View style={styles.title}>
<Text variant="text-md/medium" style={styles.titleText} lineClamp={1} color="text-default">{stateFromStores2}</Text>
{jsx(memo?.isMuted ? memo?.isTemporary ? BellZIcon : BellSlashIcon : NOOP, {
size: "xs"
})}
</View>, [stateFromStores2, memo, styles.title, styles.titleText])} subtitle={useMemo(() => message != null ? <ChannelRowPreview channel={channel} message={message} variant="text-xs/medium" color="text-strong" layout={ChannelListLayoutTypes.COZY} muted={memo.isMuted} /> : null, [channel, message, memo])} />;
};
useStyles = createStyles({
title: {
flexDirection: "row",
alignItems: "center",
gap: 4
},
titleText: {
flexShrink: 1
}
});
export default function HomeDrawerDMExpandedChildrenWrapper(props) {
const channel2 = props.channel;
const enableHome = MobileHomeDrawerExperiment.useConfig({
location: "dm-expanded-children"
}).enableHome;
const isChatBesideChannelList = useChatLayout().isChatBesideChannelList;
return enableHome ? isChatBesideChannelList ? null : <HomeDrawerDMExpandedChildren channel={channel2} /> : null;
};