109 lines
4.5 KiB
TypeScript
109 lines
4.5 KiB
TypeScript
// Module ID: 15105
|
|
// Function ID: 115027
|
|
// Name: HubItem
|
|
// Dependencies: [31, 27, 1908, 1907, 653, 10223, 33, 4131, 689, 11416, 1273, 566, 15106, 15107, 13589, 1212, 4139, 11792, 9999, 4069, 8286, 2]
|
|
// Exports: default
|
|
|
|
// Module 15105 (HubItem)
|
|
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;
|
|
function HubItem(arg0) {
|
|
let IconComponent;
|
|
let active;
|
|
let handleItemClick;
|
|
let label;
|
|
let unreadCount;
|
|
({ label, unreadCount } = arg0);
|
|
({ IconComponent, handleItemClick, active } = arg0);
|
|
const ChannelModes = require(11416) /* BaseChannelSubtitle */.ChannelModes;
|
|
const tmp2 = active ? ChannelModes.SELECTED : ChannelModes.DEFAULT;
|
|
let obj = { style: _createForOfIteratorHelperLoose().container, accessibilityLabel: label, accessibilityRole: "menuitem", onPress: handleItemClick, disableHighlightOnPress: true, mode: tmp2 };
|
|
const tmp = _createForOfIteratorHelperLoose();
|
|
const tmp3 = callback;
|
|
obj.name = callback(require(11416) /* BaseChannelSubtitle */.BaseChannelName, { name: label, mode: tmp2 });
|
|
obj.icon = callback(require(11416) /* BaseChannelSubtitle */.BaseChannelIcon, { mode: tmp2, IconComponent });
|
|
let tmp5 = null;
|
|
if (null != unreadCount) {
|
|
obj = { value: unreadCount };
|
|
tmp5 = callback(require(1273) /* Button */.Badge, obj);
|
|
}
|
|
obj.channelInfo = tmp5;
|
|
return tmp3(importDefault(11416), obj);
|
|
}
|
|
({ 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");
|
|
|
|
export default function HubSidebar(guild) {
|
|
guild = guild.guild;
|
|
let obj = guild(566);
|
|
const items = [_isNativeReflectConstruct];
|
|
const items1 = [guild.id];
|
|
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);
|
|
const items3 = [closure_5];
|
|
const stateFromStores1 = obj2.useStateFromStores(items3, () => {
|
|
let tmp = null != stateFromStores;
|
|
if (tmp) {
|
|
tmp = outer1_5.getChannelId() === stateFromStores.id;
|
|
}
|
|
return tmp;
|
|
});
|
|
guild(15106);
|
|
let tmp7Result = null;
|
|
if (null != stateFromStores) {
|
|
obj = {};
|
|
let row = null;
|
|
if (guild.flashList) {
|
|
row = tmp2.row;
|
|
}
|
|
obj.style = row;
|
|
obj = { guild };
|
|
const items4 = [callback(stateFromStores(15107), obj), , , ];
|
|
obj1 = { active: stateFromStores1, IconComponent: guild(13589).CompassIcon };
|
|
const intl = guild(1212).intl;
|
|
obj1.label = intl.string(guild(1212).t.K50GHd);
|
|
obj1.handleItemClick = function handleItemClick() {
|
|
guild(4139).transitionToChannel(stateFromStores.id);
|
|
};
|
|
obj1.unreadCount = tmp5;
|
|
items4[1] = callback(HubItem, obj1);
|
|
obj2 = { IconComponent: guild(11792).PlusMediumIcon };
|
|
const intl2 = guild(1212).intl;
|
|
obj2.label = intl2.string(guild(1212).t.emRpdS);
|
|
obj2.handleItemClick = function handleItemClick() {
|
|
let obj = stateFromStores(9999);
|
|
obj = { directoryGuildName: guild.name, directoryGuildId: guild.id, directoryChannelId: stateFromStores.id };
|
|
return obj.open(obj);
|
|
};
|
|
items4[2] = callback(HubItem, obj2);
|
|
const obj3 = { IconComponent: guild(4069).UserPlusIcon };
|
|
const intl3 = guild(1212).intl;
|
|
obj3.label = intl3.string(guild(1212).t.MJQOuJ);
|
|
obj3.handleItemClick = function handleItemClick() {
|
|
const result = guild(8286).handleOpenInviteActionsheet(guild, stateFromStores.id, dependencyMap, outer1_6.GUILD_HEADER);
|
|
};
|
|
items4[3] = callback(HubItem, obj3);
|
|
obj.children = items4;
|
|
tmp7Result = closure_8(View, obj);
|
|
const tmp7 = closure_8;
|
|
const tmp8 = View;
|
|
}
|
|
return tmp7Result;
|
|
};
|