decord/source/components_native/InAppNotificationSettingsModal.tsx

168 lines
6.3 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 10120
// Function ID: 10121
2026-07-29 08:29:29 +00:00
// Name: ConnectedInAppNotificationSettingsScreen
2026-08-24 06:08:38 +00:00
// Dependencies: [19, 1395, 1391, 4033, 5048, 1922, 676, 21, 6835, 6832, 4989, 8122, 1236, 10121, 7398, 589, 6345, 6343, 2]
2026-07-20 16:05:17 +00:00
2026-08-24 06:08:38 +00:00
// Module 10120 (ConnectedInAppNotificationSettingsScreen)
import getSystemLocale from "getSystemLocale" /* 1236 */;
import computeChannelName from "computeChannelName" /* 4989 */;
import Form from "Form" /* 8122 */;
import ChannelSettingsNotificationsGuardDefault from "ChannelSettingsNotificationsGuard" /* 10121 */;
import importAllResult from "noop" /* 19 */;
import { isMultiUserDM } from "createChannelRecord" /* 1395 */;
import closure_5 from "ensureGuildLoaded" /* 1391 */;
import closure_6 from "markAllUserIdListsStale" /* 4033 */;
import closure_7 from "updateUserGuildSettingsInternal" /* 5048 */;
import closure_8 from "mergeGuildAvatar" /* 1922 */;
import ME from "ME" /* 676 */;
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 ConnectedInAppNotificationSettingsScreen(channel) {
channel = channel.channel;
2026-07-29 08:29:29 +00:00
let obj = channel(589);
2026-08-24 06:08:38 +00:00
const items = [closure_7];
2026-07-20 16:05:17 +00:00
obj = {
channel,
isMuted: obj.useStateFromStores(items, () => {
let isChannelMutedResult;
if (null != channel) {
2026-08-24 06:08:38 +00:00
if (closure_1_4(obj.type)) {
isChannelMutedResult = closure_1_7.isChannelMuted(obj.getGuildId(), obj.id);
2026-07-20 16:05:17 +00:00
}
}
return isChannelMutedResult;
})
};
2026-07-29 08:29:29 +00:00
return callback(InAppNotificationSettingsScreen, obj);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let c3 = importAllResult;
({ ChannelTypes: c9, UserSettingsSections: c10 } = ME);
({ jsx: unpackModuleId, jsxs: closure_12 } = jsxProd);
const PureComponent = importAllResult.PureComponent;
class InAppNotificationSettingsScreen extends PureComponent {
constructor() {
applyArgumentsResult = HermesBuiltin.applyArguments(new.target, new.target);
closure_0 = applyArgumentsResult;
applyArgumentsResult.handleGroupDMMute = function handleGroupDMMute() {
({ channel, isMuted } = applyArgumentsResult.props);
if (null != channel) {
2026-08-24 06:08:38 +00:00
let obj = closure_1_1(closure_1_2[8]);
2026-07-29 08:29:29 +00:00
const guildId = channel.getGuildId();
obj = { muted: null };
obj[0] = !isMuted;
2026-08-24 06:08:38 +00:00
const NotificationLabel = applyArgumentsResult(closure_1_2[9]).NotificationLabel;
2026-07-29 08:29:29 +00:00
const result = obj.updateChannelOverrideSettings(guildId, channel.id, obj, NotificationLabel.muted(!isMuted));
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
};
applyArgumentsResult.handleOpenUserSettings = function handleOpenUserSettings() {
let obj = applyArgumentsResult(table[14]);
obj = { screen: constants.NOTIFICATIONS };
obj.openUserSettings(obj);
};
return applyArgumentsResult;
}
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const prototype = InAppNotificationSettingsScreen.prototype;
prototype["renderGroupDMNotificationSettings"] = function renderGroupDMNotificationSettings() {
const channel = this.props.channel;
if (null == channel) {
return null;
} else {
2026-08-24 06:08:38 +00:00
let obj = computeChannelName;
const channelName = obj.computeChannelName(channel, closure_8, closure_6);
2026-07-29 08:29:29 +00:00
obj = { children: null };
obj = { label: null, value: null, onValueChange: null };
2026-08-24 06:08:38 +00:00
const intl = getSystemLocale.intl;
obj1 = { name: null };
2026-07-29 08:29:29 +00:00
obj1[0] = channelName;
2026-08-24 06:08:38 +00:00
obj[0] = intl.format(getSystemLocale.t["u/rEuc"], obj1);
2026-07-29 08:29:29 +00:00
obj[1] = tmp2;
obj[2] = tmp.handleGroupDMMute;
2026-08-24 06:08:38 +00:00
obj[0] = callback(Form.FormSwitchRow, obj);
return callback(Form.FormSection, obj);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
};
prototype["renderTextChannelNotificationSettings"] = function renderTextChannelNotificationSettings() {
const channel = this.props.channel;
let tmp = null;
if (null != channel) {
const obj = { channelId: null };
obj[0] = channel.id;
2026-08-24 06:08:38 +00:00
tmp = callback(ChannelSettingsNotificationsGuardDefault, obj);
2026-07-29 08:29:29 +00:00
}
return tmp;
};
prototype["renderChannelNotificationSettings"] = function renderChannelNotificationSettings() {
const self = this;
const channel = this.props.channel;
if (null == channel) {
return null;
} else {
const type = channel.type;
if (constants.GROUP_DM === type) {
return self.renderGroupDMNotificationSettings();
} else {
if (tmp.GUILD_TEXT !== type) {
if (tmp.GUILD_ANNOUNCEMENT !== type) {
return null;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
return self.renderTextChannelNotificationSettings();
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
}
};
prototype["render"] = function render() {
let obj = { children: null };
const items = [this.renderChannelNotificationSettings(), , ];
obj = { title: null, children: null };
2026-08-24 06:08:38 +00:00
const intl = getSystemLocale.intl;
obj[0] = intl.string(getSystemLocale.t.clE4PU);
2026-07-29 08:29:29 +00:00
obj = { label: null, onPress: null, trailing: null };
2026-08-24 06:08:38 +00:00
const intl2 = getSystemLocale.intl;
obj[0] = intl2.string(getSystemLocale.t.cHMaba);
2026-07-29 08:29:29 +00:00
obj[1] = this.handleOpenUserSettings;
2026-08-24 06:08:38 +00:00
obj[2] = callback(Form.FormRow.Arrow, {});
obj[1] = callback(Form.FormRow, obj);
items[1] = callback(Form.FormSection, obj);
obj1 = { children: null };
const intl3 = getSystemLocale.intl;
obj1[0] = intl3.string(getSystemLocale.t.avgbp1);
items[2] = callback(Form.FormHint, obj1);
2026-07-29 08:29:29 +00:00
obj[0] = items;
2026-08-24 06:08:38 +00:00
return callback2(Form.Form, obj);
2026-07-29 08:29:29 +00:00
};
2026-07-20 16:05:17 +00:00
const memoResult = importAllResult.memo((channelId) => {
channelId = channelId.channelId;
const onClose = channelId.onClose;
const items = [channelId, onClose];
2026-07-29 08:29:29 +00:00
const screens = importAllResult.useMemo(() => {
2026-08-24 06:08:38 +00:00
channel = closure_1_5.getChannel(channel);
2026-07-29 08:29:29 +00:00
let obj = { IN_APP_NOTIFICATION_SETTINGS: null };
obj = {
headerTitle() {
const obj = { title: null, subtitle: null };
2026-08-24 06:08:38 +00:00
const intl = callback(closure_1_2[12]).intl;
obj[0] = intl.string(callback(closure_1_2[12]).t.h850Ss);
2026-07-29 08:29:29 +00:00
let channelName = null;
if (null != callback) {
2026-08-24 06:08:38 +00:00
const tmp3Result = callback(closure_1_2[10]);
channelName = tmp3Result.computeChannelName(tmp, closure_1_8, closure_1_6, true);
2026-07-29 08:29:29 +00:00
}
obj[1] = channelName;
2026-08-24 06:08:38 +00:00
return closure_1_11(callback(closure_1_2[16]).NavigatorHeader, obj);
2026-07-29 08:29:29 +00:00
},
2026-08-24 06:08:38 +00:00
headerLeft: channelId(closure_1_2[16]).getHeaderCloseButton(onClose),
render() {
return closure_1_11(closure_1_14, { channel: closure_0 });
}
2026-07-29 08:29:29 +00:00
};
obj[0] = obj;
return obj;
}, items);
2026-08-24 06:08:38 +00:00
return callback(channelId(6343).Navigator, { screens, initialRouteName: "IN_APP_NOTIFICATION_SETTINGS" });
2026-07-20 16:05:17 +00:00
});
2026-08-24 06:08:38 +00:00
let result = require("set").fileFinishedImporting("components_native/InAppNotificationSettingsModal.tsx");
2026-07-20 16:05:17 +00:00
export default memoResult;