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,45 @@
// Metro module 11473 (f11474).
import { useCallback } from "react";
import ReadStateStore from "../../../../stores/ReadStateStore";
import UserGuildSettingsStore from "../../../../stores/UserGuildSettingsStore";
import { ReadStateTypes } from "../../../read_states/ReadStateConstants";
import { useStateFromStoresObject, useStateFromStores } from "../../../../_bundle/Module589";
import useGuildScheduledEvents from "../../useGuildScheduledEvents";
import { shouldShowMembershipVerificationGate } from "../../../guild_member_verification/hooks/useShowMemberVerificationGate";
import { openMemberVerificationModal } from "../../../guild_member_verification/MemberVerificationModalActionCreators";
import { openGuildEventListActionSheet } from "../GuildScheduledEventModalActionCreators";
import ActionSheetActionCreators from "../../../action_sheet/native/ActionSheetActionCreators";
import { intl, t } from "../../../../intl/index.native";
import { ChannelModes } from "../../../guild_sidebar/native/BaseChannelItem";
export default function useEventsButtonProps(a0) {
const stateFromStoresObject = useStateFromStoresObject([ReadStateStore], () => ({
hasUnread: ReadStateStore.hasUnread(a0.id, ReadStateTypes.GUILD_EVENT),
mentionCount: ReadStateStore.getMentionCount(a0.id, ReadStateTypes.GUILD_EVENT)
}), [a0.id]);
const { hasUnread, mentionCount } = stateFromStoresObject;
const stateFromStores = useStateFromStores([UserGuildSettingsStore], () => UserGuildSettingsStore.isMuteScheduledEventsEnabled(a0.id));
const guildScheduledEvents = useGuildScheduledEvents(a0.id);
const callback = useCallback(() => shouldShowMembershipVerificationGate(a0.id) ? openMemberVerificationModal(a0.id) : openGuildEventListActionSheet(a0), [a0]);
const callback2 = useCallback(() => {
const r14 = import("../components/UpcomingEventsLongPressActionSheet");
ActionSheetActionCreators.openLazy(r14, `UpcomingEventsLongPress-${a0.id}`, {
guildId: a0.id
});
}, [a0.id]);
const name = guildScheduledEvents.length > 0 ? intl.formatToPlainString(t.IBdqSu, {
number: guildScheduledEvents.length
}) : intl.string(t.tlopTM);
let DEFAULT = ChannelModes.DEFAULT;
if (hasUnread && !stateFromStores) {
DEFAULT = ChannelModes.UNREAD_IMPORTANT;
}
return {
hasUnread,
mentionCount,
mode: DEFAULT,
name,
eventsMuted: stateFromStores,
handlePress: callback,
handleLongPress: callback2
};
};