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

94 lines
7.1 KiB
TypeScript

/* Metro module 14589; source: modules/guild_sidebar/native/GuildActionRows.tsx; dependencies: [31, 27, 5096, 4605, 10980, 6600, 4865, 33, 4501, 697, 6941, 3968, 1365, 632, 5092, 5080, 11350, 1962, 11846, 11814, 1244, 12376, 2] */
import ReadStateStore from '../../../stores/ReadStateStore.tsx'; /* Metro dependency 4605 */
import NewChannelsStore from '../../recent_channels/NewChannelsStore.tsx'; /* Metro dependency 5096 */
import UseGuildOnboardingAvailable from '../../guild_onboarding/useGuildOnboardingAvailable.tsx'; /* Metro dependency 6941 */
import BaseChannelItem from './BaseChannelItem.tsx'; /* Metro dependency 11846 */
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 IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as Dismissible_contentModule from '../../../external/discord_common/js/packages/protos/discord_protos/discord_users/v1/dismissible_content.tsx'; /* Metro dependency 1365 */
import * as DismissibleContentUnsafeUtilsModule from '../../dismissible_content/DismissibleContentUnsafeUtils.tsx'; /* Metro dependency 3968 */
import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
import * as ReadStateConstantsModule from '../../read_states/ReadStateConstants.tsx'; /* Metro dependency 4865 */
import * as GuildOnboardingConstantsModule from '../../guild_onboarding/native/GuildOnboardingConstants.tsx'; /* Metro dependency 6600 */
import * as RedesignChannelListConstantsModule from '../../channel_list_v2/native/RedesignChannelListConstants.tsx'; /* Metro dependency 10980 */
import * as ChannelListMagnifyingGlassIconModule from '../../../design/components/Icon/native/redesign/generated/ChannelListMagnifyingGlassIcon.tsx'; /* Metro dependency 12376 */
function _fun110331(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#110331, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14786:6, offset: 0x0237509a, size: 340 bytes, params: 8, frame: 23
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const CHANNEL_MARGIN_VERTICAL = (RedesignChannelListConstantsModule).CHANNEL_MARGIN_VERTICAL;
const createStyles = CreateStylesModule.createStyles;
const object2 = {marginVertical: CHANNEL_MARGIN_VERTICAL, marginHorizontal: 8};
object2.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.md;
const env0_10 = Reflect.apply(createStyles, CreateStylesModule, [{container: object2,
channelInfoContainer: {paddingStart: 4}}]);
(FileImportTrackerModule).fileFinishedImporting('modules/guild_sidebar/native/GuildActionRows.tsx');
exports.GuildRolesAndChannelsRow = GuildRolesAndChannelsRow;
function GuildRolesAndChannelsRow({guild, selected}) { // fn#110332, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14786:505, offset: 0x023751ee, size: 695 bytes, params: 2, frame: 26
const styles = useStyles();
const value2 = (UseGuildOnboardingAvailable)(guild);
const id = guild.id;
const UNSAFE_useIsDismissibleContentDismissed = DismissibleContentUnsafeUtilsModule.UNSAFE_useIsDismissibleContentDismissed;
const DismissibleContent = (Dismissible_contentModule).DismissibleContent;
const CHANNEL_BROWSER_NEW_BADGE_NUX = DismissibleContent.CHANNEL_BROWSER_NEW_BADGE_NUX;
const value3 = Reflect.apply(UNSAFE_useIsDismissibleContentDismissed, DismissibleContentUnsafeUtilsModule,
[CHANNEL_BROWSER_NEW_BADGE_NUX]);
const value4 = (require(632) /* metro dependency 632: useStateFromStores */).useStateFromStores([ReadStateStore],
function() {
return ReadStateStore.hasUnread(guild.id, ReadStateTypes.GUILD_ONBOARDING_QUESTION);
});
const value5 = (require(632) /* metro dependency 632: useStateFromStores */).useStateFromStores([NewChannelsStore],
function() {
return NewChannelsStore.getNewChannelIds(guild.id).size > require(dependencyMap[14]).MAX_NEW_CHANNELS_TO_SHOW;
});
const value6 = ReactModule.useCallback(function() {
importDefault(dependencyMap[15]).pushLazy(require(dependencyMap[17])(dependencyMap[16], dependencyMap.paths),
{guildId: id}, CHANNELS_AND_ROLES_MODAL_KEY);
}, [id]);
const ChannelModes = (require(11846) /* metro dependency 11846: BaseChannelItem */).ChannelModes;
const DEFAULT = ChannelModes.DEFAULT;
const r8 = selected ? (require(11846) /* metro dependency 11846: BaseChannelItem */).ChannelModes.SELECTED : DEFAULT;
let r0 = value3 ? value4 : !value3;
r0 = !r0 ? value5 : r0;
const r4 = (
r0
? (
<View style={styles.channelInfoContainer}>
{((NewBadge) => <NewBadge />)((require(11814) /* metro dependency 11814: components */).NewBadge)}
</View>
)
: null
);
const defaultImportProps = {onPress: value6, style: styles.container, accessible: true};
const intl = (IndexNativeModule).intl;
let string = intl.string;
const t = (IndexNativeModule).t;
defaultImportProps.accessibilityLabel = value2 ? Reflect.apply(string, intl, [t.h9mGOP]) : Reflect.apply(string,
intl, [t.et6wav]);
defaultImportProps.accessibilityState = {selected: selected};
defaultImportProps.mode = r8;
const BaseChannelName = (require(11846) /* metro dependency 11846: BaseChannelItem */).BaseChannelName;
string = intl.string;
defaultImportProps.name = (
<BaseChannelName
name={value2 ? Reflect.apply(string, intl, [t.h9mGOP]) : Reflect.apply(string, intl, [t.et6wav])}
mode={r8}
/>
);
const BaseChannelIcon = (require(11846) /* metro dependency 11846: BaseChannelItem */).BaseChannelIcon;
const ChannelListMagnifyingGlassIcon = (ChannelListMagnifyingGlassIconModule).ChannelListMagnifyingGlassIcon;
defaultImportProps.icon = <BaseChannelIcon mode={r8} IconComponent={ChannelListMagnifyingGlassIcon} />;
defaultImportProps.channelInfo = r4;
return <BaseChannelItem {...defaultImportProps} />;
}
}
global.__d(_fun110331, 14589, [31, 27, 5096, 4605, 10980, 6600, 4865, 33, 4501, 697, 6941, 3968, 1365, 632, 5092,
5080, 11350, 1962, 11846, 11814, 1244, 12376,
2]) /* metro module 14589, dependencies: [31, 27, 5096, 4605, 10980, 6600, 4865, 33, 4501, 697, 6941, 3968, 1365, 632, 5092, 5080, 11350, 1962, 11846, 11814, 1244, 12376, 2] */;