Files
discord-decomp/sources/modules/notification_settings/native/NotificationSettingChannelOverrides.native.tsx
T
2026-07-28 01:06:53 +03:00

187 lines
11 KiB
TypeScript

/* Metro module 16129; source: modules/notification_settings/native/NotificationSettingChannelOverrides.native.tsx; dependencies: [57, 31, 27, 1383, 5098, 3793, 1878, 661, 33, 4501, 697, 566, 5463, 5099, 4805, 6590, 1244, 3869, 7705, 6238, 6242, 6647, 7699, 6984, 1305, 8754, 8671, 2] */
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
import Native from '../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
import UserStore from '../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
import RelationshipStore from '../../../stores/RelationshipStore.tsx'; /* Metro dependency 3793 */
import GuildCategoryStore from '../../../stores/GuildCategoryStore.tsx'; /* Metro dependency 5098 */
import UseSafeAreaInsetsKeyboardAwareNative from '../../safe_area/useSafeAreaInsetsKeyboardAware.native.tsx'; /* Metro dependency 5463 */
import UseFastestListTableRowPlaceholderConfigNative from '../../fastest_list/placeholders/useFastestListTableRowPlaceholderConfig.native.tsx'; /* Metro dependency 7699 */
import UseScaledRowHeight from '../../main_tabs_v2/native/shared_components/user_list/useScaledRowHeight.tsx'; /* Metro dependency 7705 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactNativeModule from '../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as ChannelRecordModule from '../../../records/ChannelRecord.tsx'; /* Metro dependency 1383 */
import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
import * as UseChannelNameModule from '../../channel/useChannelName.tsx'; /* Metro dependency 4805 */
import * as TableRowNativeModule from '../../../design/components/TableRow/native/TableRow.native.tsx'; /* Metro dependency 6238 */
import * as TableRowIconNativeModule from '../../../design/components/TableRow/native/TableRowIcon.native.tsx'; /* Metro dependency 6242 */
import * as SearchFieldNativeModule from '../../../design/components/TextField/native/SearchField.native.tsx'; /* Metro dependency 6984 */
function _fun124536(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#124536, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16337:6, offset: 0x025bc48e, size: 396 bytes, params: 8, frame: 24
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = ReactModule;
const createStyles = CreateStylesModule.createStyles;
object = {};
const PX_8 = (Native).space.PX_8;
object.container = {marginHorizontal: PX_8, flex: 1};
const PX_16 = (Native).space.PX_16;
object.searchContainer = {paddingVertical: PX_16};
const env0_14 = Reflect.apply(createStyles, CreateStylesModule, [object]);
value = value.memo(NotificationSettingChannelOverrides);
(FileImportTrackerModule).fileFinishedImporting('modules/notification_settings/native/NotificationSettingChannelOverrides.native.tsx');
exports.default = value;
function NotificationSettingChannelOverrides({guildId, navigation}) { // fn#124537, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16337:429, offset: 0x025bc61a, size: 704 bytes, params: 2, frame: 31
var r5;
var EmptyState;
var value;
const styles = useStyles();
const categories = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildCategoryStore],
function() {
return GuildCategoryStore.getCategories(guildId);
});
const insets = (UseSafeAreaInsetsKeyboardAwareNative)().insets;
const binding = env0_4;
const [property, property2] = Module00057(binding.useState(''), 2);
const {channels, sections} = binding.useMemo(_fun124539, [categories, property]);
binding.useEffect(_fun124542, [channels, property]);
const value5 = (UseScaledRowHeight)();
const value6 = binding.useCallback(_fun124543, [channels, navigation]);
const value7 = (UseFastestListTableRowPlaceholderConfigNative)();
const SearchField = (SearchFieldNativeModule).SearchField;
const intl = (IndexNativeModule).intl;
const string = intl.string;
const t = (IndexNativeModule).t;
const view = (
<View style={styles.searchContainer}>
<SearchField placeholder={Reflect.apply(string, intl, [t['5h0QOP']])} onChange={property2} />
</View>
);
if (channels.length === 0) {
EmptyState = (require(1305) /* metro dependency 1305: native */).EmptyState;
r5 = (
<EmptyState
Illustration={(require(8754) /* metro dependency 8754: NoResults */).NoResults}
title={intl.string(t.wM7uRI)}
body={intl.string(t.f5cMAg)}
/>
);
} else {
value = importDefault(8671) /* metro dependency 8671: FastestListAndroid */;
value = ((Component) => <Component sections={sections} renderItem={value6} itemSize={value5} insetEnd={insets.bottom} estimatedListSize="windowSize" placeholderConfig={value7} wrapChildren />)(value);
r5 = value;
}
return (
<View style={styles.container}>
{view}
{r5}
</View>
);
function _fun124539() { // fn#124539, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16337:643, offset: 0x025bc8da, size: 98 bytes, params: 1, frame: 16
var environment;
let value = environment.__proto__;
value = importDefault(5099) /* metro dependency 5099: getFlattedChannelList */;
const categoriesBinding = categories;
value = value(categoriesBinding._categories, categoriesBinding, _fun124540);
value = value.map(function(a0) {
return a0.channel;
});
return {channels: value, sections: [value.length]};
function _fun124540({channel}) { // fn#124540, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16337:680, offset: 0x025bc93c, size: 230 bytes, params: 2, frame: 20
var r1;
var r0;
var value7;
var moduleValue;
var value8;
var binding;
let value = environment.__proto__.__proto__;
const isGuildReadableType2 = isGuildReadableType(channel.type);
if (isGuildReadableType2) {
r0 = isGuildReadableType2;
} else {
r1 = channel.type === ChannelTypes.GUILD_CATEGORY && categories[channel.id] != null;
r1 = r1 && categories[channel.id].length > 0;
r0 = r1;
}
if (r0) {
value7 = environment.__proto__;
if (env1_3 === '') {
return r0;
}
if (env1_3 == null) {
return r0;
}
moduleValue = require(4805) /* metro dependency 4805: useChannelName */;
value8 = moduleValue.computeChannelName(channel, UserStore, RelationshipStore).toLowerCase();
value = importDefault(6590) /* metro dependency 6590 */;
binding = env1_3;
return value(binding.toLowerCase(), value8);
}
return false;
}
}
function _fun124542() { // fn#124542, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16337:1019, offset: 0x025bca22, size: 221 bytes, params: 1, frame: 17
var r2;
var length;
const intl = (IndexNativeModule).intl;
const t = (IndexNativeModule).t;
var value;
if (Module00057 != null) {
if (Module00057 !== '') {
length = channels.length;
if (length > 0) {
value = environment.__proto__;
value = intl.formatToPlainString(t.ZGVL3g, {count: length});
r2 = value;
} else {
value = environment.__proto__;
value = intl.string(t.f5cMAg);
r2 = value;
}
value = environment.__proto__;
(require(3869) /* metro dependency 3869: AccessibilityAnnouncerAndroid */).AccessibilityAnnouncer.announce(r2);
}
}
}
function _fun124543(a0, a1) { // fn#124543, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16337:1256, offset: 0x025bcaff, size: 212 bytes, params: 3, frame: 25
const channelsBinding = channels;
const property = channelsBinding[a1];
const TableRow = (TableRowNativeModule).TableRow;
const object = {};
const TableRowIcon = (TableRowIconNativeModule).TableRowIcon;
object.icon = (
<TableRowIcon
IconComponent={(require(6647) /* metro dependency 6647: ChannelUtils */).getChannelIconComponent(property)}
/>
);
object.start = a1 === 0;
object.end = a1 === channelsBinding.length - 1;
object.label = UseChannelNameModule.computeChannelName(property, UserStore, RelationshipStore);
object.labelLineClamp = 1;
object.arrow = true;
object.onPress = onPress_124544;
return <TableRow {...object} />;
function onPress_124544() { // fn#124544, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16337:1491, offset: 0x025bcbd3, size: 53 bytes, params: 1, frame: 14
const navigationBinding = navigation;
const push = navigationBinding.push;
const CHANNEL_OVERRIDE = NotificationSettingsSections.CHANNEL_OVERRIDE;
Reflect.apply(push, navigationBinding, [CHANNEL_OVERRIDE, {channelId: env0_0.id}]);
}
}
}
}
global.__d(_fun124536, 16129, [57, 31, 27, 1383, 5098, 3793, 1878, 661, 33, 4501, 697, 566, 5463, 5099, 4805, 6590,
1244, 3869, 7705, 6238, 6242, 6647, 7699, 6984, 1305, 8754, 8671,
2]) /* metro module 16129, dependencies: [57, 31, 27, 1383, 5098, 3793, 1878, 661, 33, 4501, 697, 566, 5463, 5099, 4805, 6590, 1244, 3869, 7705, 6238, 6242, 6647, 7699, 6984, 1305, 8754, 8671, 2] */;