decord/source/modules/notifications/settings/native/NotificationSettingsChannel.tsx

101 lines
4.6 KiB
TypeScript
Raw Normal View History

2026-07-23 10:11:24 +00:00
// Module ID: 10287
// Function ID: 79456
2026-07-20 16:05:17 +00:00
// Name: NotificationSettingsChannel
2026-07-23 10:11:24 +00:00
// Dependencies: [31, 27, 4325, 33, 4130, 689, 10288, 1212, 4320, 1456, 5087, 5079, 5073, 566, 7495, 10290, 10291, 10295, 10302, 10308, 4543, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-07-23 10:11:24 +00:00
// Module 10287 (NotificationSettingsChannel)
import result from "result";
import { View } from "get ActivityIndicator";
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
import jsxProd from "jsxProd";
import _createForOfIteratorHelperLoose from "_createForOfIteratorHelperLoose";
let closure_6;
let closure_7;
const require = arg1;
({ jsx: closure_6, jsxs: closure_7 } = jsxProd);
_createForOfIteratorHelperLoose = {};
_createForOfIteratorHelperLoose = { flex: 1, backgroundColor: require("_createForOfIteratorHelperLoose").colors.BACKGROUND_BASE_LOW, padding: 16 };
_createForOfIteratorHelperLoose.screenContainer = _createForOfIteratorHelperLoose;
_createForOfIteratorHelperLoose = _createForOfIteratorHelperLoose.createStyles(_createForOfIteratorHelperLoose);
let result = require("_isNativeReflectConstruct").fileFinishedImporting("modules/notifications/settings/native/NotificationSettingsChannel.tsx");
2026-07-20 16:05:17 +00:00
export default function NotificationSettingsChannel(channel) {
2026-07-23 10:11:24 +00:00
const _require = channel;
let obj = _require(10288);
2026-07-20 16:05:17 +00:00
const channelPresetInheritance = obj.useChannelPresetInheritance(channel.channel);
2026-07-23 10:11:24 +00:00
const intl = _require(1212).intl;
const importDefault = intl.string(_require(1212).t.h850Ss);
const dependencyMap = importDefault(4320)(channel.channel);
let obj1 = _require(1456);
2026-07-20 16:05:17 +00:00
const React = obj1.useNavigation();
const layoutEffect = React.useLayoutEffect(() => {
let obj = {
2026-07-23 10:11:24 +00:00
title: "" + closure_1 + " (" + dependencyMap + ")",
2026-07-20 16:05:17 +00:00
headerTitle() {
2026-07-23 10:11:24 +00:00
return outer2_6(callback(table[10]).NavigatorHeader, { title: outer1_1, subtitle: outer1_2 });
2026-07-20 16:05:17 +00:00
}
};
store.setOptions(obj);
2026-07-23 10:11:24 +00:00
if (channel.inGuildContext) {
obj = { headerLeft: channel(5087).getHeaderBackButton(() => outer1_3.popToTop()) };
2026-07-20 16:05:17 +00:00
store.setOptions(obj);
2026-07-23 10:11:24 +00:00
const obj3 = channel(5087);
2026-07-20 16:05:17 +00:00
}
});
const items = [channel.channel];
const items1 = [channel.channel];
2026-07-23 10:11:24 +00:00
const callback = React.useCallback(() => channel(10288).updateChannelToGuildDefault(channel.channel.guild_id, channel.channel.id), items);
2026-07-20 16:05:17 +00:00
const callback1 = React.useCallback(() => {
2026-07-23 10:11:24 +00:00
let obj = callback(5079);
2026-07-20 16:05:17 +00:00
obj = { muted: false };
2026-07-23 10:11:24 +00:00
const result = obj.updateChannelOverrideSettings(channel.channel.guild_id, channel.channel.id, obj, channel(5073).NotificationLabels.Unmuted);
2026-07-20 16:05:17 +00:00
}, items1);
2026-07-23 10:11:24 +00:00
let obj2 = _require(566);
const items2 = [_isNativeReflectConstruct];
const stateFromStoresObject = obj2.useStateFromStoresObject(items2, () => ({ config: outer1_5.getChannelMuteConfig(channel.channel.guild_id, channel.channel.id), muted: outer1_5.isChannelMuted(channel.channel.guild_id, channel.channel.id) }));
obj = { style: _createForOfIteratorHelperLoose().screenContainer };
2026-07-20 16:05:17 +00:00
let muted = stateFromStoresObject.muted;
if (muted) {
obj = {};
obj1 = { marginBottom: 16 };
obj.style = obj1;
2026-07-23 10:11:24 +00:00
const intl2 = _require(1212).intl;
obj.title = intl2.string(_require(1212).t["6MCxAy"]);
let obj6 = _require(10290);
2026-07-20 16:05:17 +00:00
obj.subtitle = obj6.getMuteBannerSubtitleFromConfig(stateFromStoresObject.config);
obj.onPressUnmute = callback1;
2026-07-23 10:11:24 +00:00
muted = callback(_require(10290).NotificationSettingsMuteBanner, obj);
2026-07-20 16:05:17 +00:00
}
const items3 = [muted, , , , , ];
obj2 = { channel: channel.channel };
2026-07-23 10:11:24 +00:00
items3[1] = callback(_require(10291).NotificationSettingsChannelPresets, obj2);
items3[2] = callback(_require(10295).NotificationSettingsChannelMessageNotification, { style: { marginTop: 24 }, channel: channel.channel });
items3[3] = callback(_require(10302).NotificationSettingsChannelMessageUnread, { style: { marginTop: 24 }, channel: channel.channel });
2026-07-20 16:05:17 +00:00
channel = channel.channel;
let isForumLikeChannelResult = channel.isForumLikeChannel();
if (isForumLikeChannelResult) {
const obj5 = {};
obj6 = { marginTop: 24 };
obj5.style = obj6;
obj5.channel = channel.channel;
2026-07-23 10:11:24 +00:00
isForumLikeChannelResult = callback(_require(10308).NotificationSettingsChannelPost, obj5);
2026-07-20 16:05:17 +00:00
}
items3[4] = isForumLikeChannelResult;
let tmp15 = !channelPresetInheritance.inherited;
if (tmp15) {
const obj7 = {};
const obj8 = { marginTop: 24 };
obj7.style = obj8;
const obj9 = { variant: "secondary", onPress: callback };
2026-07-23 10:11:24 +00:00
const intl3 = _require(1212).intl;
obj9.text = intl3.string(_require(1212).t["3PBFN6"]);
obj7.children = callback(_require(4543).Button, obj9);
2026-07-20 16:05:17 +00:00
tmp15 = callback(View, obj7);
}
items3[5] = tmp15;
obj.children = items3;
2026-07-23 10:11:24 +00:00
return closure_7(_require(7495).Form, obj);
2026-07-20 16:05:17 +00:00
};