89 lines
3.5 KiB
TypeScript
89 lines
3.5 KiB
TypeScript
// Metro module 14943 (f14944).
|
|
import LurkingStore from "../../../lurker_mode/LurkingStore";
|
|
import GuildStore from "../../../../stores/GuildStore";
|
|
import UserGuildSettingsStore from "../../../../stores/UserGuildSettingsStore";
|
|
import { AnalyticsSections } from "../../../../Constants";
|
|
import { DoorExitIcon } from "../../../../design/components/Icon/native/redesign/generated/DoorExitIcon";
|
|
import { intl, t } from "../../../../intl/index.native";
|
|
import { trackLongPressLeaveClicked } from "../../../lurker_mode/LurkerPreviewAnalytics";
|
|
import { stopLurkingForGuild } from "../../../lurker_mode/LurkerActionCreators";
|
|
import * as _NotificationUtils from "../../../notifications/NotificationUtils";
|
|
import { EnvelopeIcon } from "../../../../design/components/Icon/native/redesign/generated/EnvelopeIcon";
|
|
import { BellIcon } from "../../../../design/components/Icon/native/redesign/generated/BellIcon";
|
|
import NotificationSettingsModalActionCreators from "../../../../actions/NotificationSettingsModalActionCreators";
|
|
import { SettingsIcon } from "../../../../design/components/Icon/native/redesign/generated/SettingsIcon";
|
|
import openGuildActionSheet from "../../../guild_action_sheet/native/openGuildActionSheet";
|
|
import Module11476 from "../../../../_bundle/Module11476";
|
|
import ActionSheetActionCreators from "../../../action_sheet/native/ActionSheetActionCreators";
|
|
import Module11477 from "../../../../_bundle/Module11477";
|
|
import { NotificationLabels } from "../../../../utils/NotificationSettingsUtils";
|
|
export default function getGuildsBarGuildMenuItems(a0) {
|
|
const guildId = a0;
|
|
if (LurkingStore.isLurking(a0)) {
|
|
return [{
|
|
IconComponent: DoorExitIcon,
|
|
label: intl.string(t["2vl7qn"]),
|
|
variant: "destructive",
|
|
action: () => {
|
|
trackLongPressLeaveClicked(guildId);
|
|
stopLurkingForGuild(guildId);
|
|
}
|
|
}];
|
|
}
|
|
const shouldShowUseNewNotificationSystem = _NotificationUtils.shouldShowUseNewNotificationSystem("GuildPopoutMenu");
|
|
const isMuted = UserGuildSettingsStore.isMuted(a0);
|
|
const r34 = [{
|
|
IconComponent: EnvelopeIcon,
|
|
label: intl.string(t.e6RscS),
|
|
action: async () => {
|
|
let c30809_0;
|
|
c30809_0 = void 0;
|
|
(0, (await import("../../../guild/markGuildsAsRead")).default)([guildId], AnalyticsSections.GUILD_LIST);
|
|
}
|
|
}, {
|
|
IconComponent: BellIcon,
|
|
label: intl.string(t.HcoRu0),
|
|
action: () => {
|
|
NotificationSettingsModalActionCreators.open(guildId);
|
|
}
|
|
}, {
|
|
IconComponent: SettingsIcon,
|
|
label: intl.string(t.PdRCRg),
|
|
action: () => {
|
|
const guild = GuildStore.getGuild(guildId);
|
|
if (guild != null) {
|
|
openGuildActionSheet(guild);
|
|
}
|
|
}
|
|
}];
|
|
if (shouldShowUseNewNotificationSystem) {
|
|
const r63 = {
|
|
iconSource: null,
|
|
label: null,
|
|
action: null
|
|
};
|
|
if (isMuted) {
|
|
r63.iconSource = Module11477;
|
|
r63.label = intl.string(t.De0BTC);
|
|
r63.action = () => {
|
|
if (guildId != null) {
|
|
NotificationSettingsModalActionCreators.updateGuildNotificationSettings(guildId, {
|
|
muted: false
|
|
}, NotificationLabels.Unmuted);
|
|
}
|
|
};
|
|
r34.splice(1, 0, r63);
|
|
} else {
|
|
r63.iconSource = Module11476;
|
|
r63.label = intl.string(t.vRzp7P);
|
|
r63.action = () => {
|
|
ActionSheetActionCreators.openLazy(import("../../../main_tabs_v2/native/sidebar/details/screens/MuteSettingsActionSheet"), `muteSettings${guildId}`, {
|
|
guildId
|
|
});
|
|
};
|
|
r34.splice(1, 0, r63);
|
|
}
|
|
}
|
|
return r34;
|
|
};
|