decord/source/modules/hub/native/components/HubSidebar.tsx

110 lines
4.5 KiB
TypeScript
Raw Normal View History

2026-07-24 07:16:23 +00:00
// Module ID: 15083
// Function ID: 114854
2026-07-20 16:05:17 +00:00
// Name: HubItem
2026-07-24 07:16:23 +00:00
// Dependencies: [31, 27, 1907, 1906, 653, 10289, 33, 4130, 689, 11452, 1273, 566, 15084, 15085, 13577, 1212, 4138, 11815, 10070, 4068, 8526, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-07-24 07:16:23 +00:00
// Module 15083 (HubItem)
2026-07-23 10:11:24 +00:00
import "result";
import { View } from "get ActivityIndicator";
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
import closure_5 from "_isNativeReflectConstruct";
import { InstantInviteSources } from "ME";
import jsxProd from "jsxProd";
import _createForOfIteratorHelperLoose from "_createForOfIteratorHelperLoose";
let closure_7;
let closure_8;
const require = arg1;
2026-07-20 16:05:17 +00:00
function HubItem(arg0) {
let IconComponent;
let active;
let handleItemClick;
let label;
let unreadCount;
({ label, unreadCount } = arg0);
({ IconComponent, handleItemClick, active } = arg0);
2026-07-24 07:16:23 +00:00
const ChannelModes = require(11452) /* BaseChannelSubtitle */.ChannelModes;
2026-07-20 16:05:17 +00:00
const tmp2 = active ? ChannelModes.SELECTED : ChannelModes.DEFAULT;
2026-07-23 10:11:24 +00:00
let obj = { style: _createForOfIteratorHelperLoose().container, accessibilityLabel: label, accessibilityRole: "menuitem", onPress: handleItemClick, disableHighlightOnPress: true, mode: tmp2 };
const tmp = _createForOfIteratorHelperLoose();
2026-07-20 16:05:17 +00:00
const tmp3 = callback;
2026-07-24 07:16:23 +00:00
obj.name = callback(require(11452) /* BaseChannelSubtitle */.BaseChannelName, { name: label, mode: tmp2 });
obj.icon = callback(require(11452) /* BaseChannelSubtitle */.BaseChannelIcon, { mode: tmp2, IconComponent });
2026-07-20 16:05:17 +00:00
let tmp5 = null;
if (null != unreadCount) {
obj = { value: unreadCount };
2026-07-23 10:11:24 +00:00
tmp5 = callback(require(1273) /* Button */.Badge, obj);
2026-07-20 16:05:17 +00:00
}
obj.channelInfo = tmp5;
2026-07-24 07:16:23 +00:00
return tmp3(importDefault(11452), obj);
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
({ jsx: closure_7, jsxs: closure_8 } = jsxProd);
_createForOfIteratorHelperLoose = {};
_createForOfIteratorHelperLoose = { marginVertical: require("hairlineWidth").CHANNEL_MARGIN_VERTICAL, marginHorizontal: 8, borderRadius: require("_createForOfIteratorHelperLoose").radii.md };
_createForOfIteratorHelperLoose.container = _createForOfIteratorHelperLoose;
_createForOfIteratorHelperLoose.row = { flex: 1 };
_createForOfIteratorHelperLoose = _createForOfIteratorHelperLoose.createStyles(_createForOfIteratorHelperLoose);
let result = require("_isNativeReflectConstruct").fileFinishedImporting("modules/hub/native/components/HubSidebar.tsx");
2026-07-20 16:05:17 +00:00
export default function HubSidebar(guild) {
guild = guild.guild;
2026-07-23 10:11:24 +00:00
let obj = guild(566);
const items = [_isNativeReflectConstruct];
2026-07-20 16:05:17 +00:00
const items1 = [guild.id];
2026-07-23 10:11:24 +00:00
const stateFromStores = obj.useStateFromStores(items, () => outer1_4.getDefaultChannel(guild.id), items1);
let obj1 = guild(566);
const items2 = [_isNativeReflectConstruct];
const dependencyMap = obj1.useStateFromStoresObject(items2, () => outer1_4.getChannels(guild.id));
let obj2 = guild(566);
2026-07-20 16:05:17 +00:00
const items3 = [closure_5];
const stateFromStores1 = obj2.useStateFromStores(items3, () => {
let tmp = null != stateFromStores;
if (tmp) {
2026-07-23 10:11:24 +00:00
tmp = outer1_5.getChannelId() === stateFromStores.id;
2026-07-20 16:05:17 +00:00
}
return tmp;
});
2026-07-24 07:16:23 +00:00
guild(15084);
2026-07-20 16:05:17 +00:00
let tmp7Result = null;
if (null != stateFromStores) {
obj = {};
let row = null;
if (guild.flashList) {
row = tmp2.row;
}
obj.style = row;
obj = { guild };
2026-07-24 07:16:23 +00:00
const items4 = [callback(stateFromStores(15085), obj), , , ];
obj1 = { active: stateFromStores1, IconComponent: guild(13577).CompassIcon };
2026-07-23 10:11:24 +00:00
const intl = guild(1212).intl;
obj1.label = intl.string(guild(1212).t.K50GHd);
2026-07-20 16:05:17 +00:00
obj1.handleItemClick = function handleItemClick() {
2026-07-23 10:11:24 +00:00
guild(4138).transitionToChannel(stateFromStores.id);
2026-07-20 16:05:17 +00:00
};
obj1.unreadCount = tmp5;
items4[1] = callback(HubItem, obj1);
2026-07-24 07:16:23 +00:00
obj2 = { IconComponent: guild(11815).PlusMediumIcon };
2026-07-23 10:11:24 +00:00
const intl2 = guild(1212).intl;
obj2.label = intl2.string(guild(1212).t.emRpdS);
2026-07-20 16:05:17 +00:00
obj2.handleItemClick = function handleItemClick() {
2026-07-24 07:16:23 +00:00
let obj = stateFromStores(10070);
2026-07-20 16:05:17 +00:00
obj = { directoryGuildName: guild.name, directoryGuildId: guild.id, directoryChannelId: stateFromStores.id };
return obj.open(obj);
};
items4[2] = callback(HubItem, obj2);
2026-07-23 10:11:24 +00:00
const obj3 = { IconComponent: guild(4068).UserPlusIcon };
const intl3 = guild(1212).intl;
obj3.label = intl3.string(guild(1212).t.MJQOuJ);
2026-07-20 16:05:17 +00:00
obj3.handleItemClick = function handleItemClick() {
2026-07-24 07:16:23 +00:00
const result = guild(8526).handleOpenInviteActionsheet(guild, stateFromStores.id, dependencyMap, outer1_6.GUILD_HEADER);
2026-07-20 16:05:17 +00:00
};
items4[3] = callback(HubItem, obj3);
obj.children = items4;
tmp7Result = closure_8(View, obj);
const tmp7 = closure_8;
const tmp8 = View;
}
return tmp7Result;
};