decord/source/components_native/channel_settings/ChannelSettingsInstantInvites.tsx

144 lines
5.5 KiB
TypeScript
Raw Normal View History

// Module ID: 16859
// Function ID: 16860
// Name: ChannelSettingsInstantInvites
// Dependencies: [32, 19, 17, 8659, 1957, 1074, 21, 4574, 576, 1611, 504, 8658, 10964, 1178, 10981, 10982, 1114, 7053, 16860, 7069, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
// Module 16859 (ChannelSettingsInstantInvites)
import nativeDefault from "native" /* 576 */;
import useSafeAreaInsetsDefault from "useSafeAreaInsets" /* 1611 */;
import InstantInvite from "InstantInvite" /* 10964 */;
import _slicedToArray from "module_32" /* 32 */;
import noop from "module_19" /* 19 */;
import ChannelSettingsStore from "ChannelSettingsStore" /* 8659 */;
import ChannelStore from "ChannelStore" /* 1957 */;
2026-07-23 10:11:24 +00:00
const require = globalThis.__r;
const InstantInviteDefault = InstantInvite;
const FastestListDefault = tmp2(7069);
const _modDef10981 = tmp2(10981);
const _modDef10982 = tmp2(10982);
const InstantInviteSelfMeasurerDefault = tmp2(16860);
require = fn;
const View = fn(17).View;
const ChannelSettingsSections = fn(1074).ChannelSettingsSections;
const jsxProd = fn(21);
({ jsx: closure_9, jsxs: c10 } = jsxProd);
const createStyles = fn(4574);
let obj2 = { content: { paddingHorizontal: nativeDefault.space.PX_16, backgroundColor: nativeDefault.colors.BACKGROUND_BASE_LOWER, flex: 1 }, gap: null };
let obj3 = { paddingHorizontal: nativeDefault.space.PX_16, backgroundColor: nativeDefault.colors.BACKGROUND_BASE_LOWER, flex: 1 };
obj2.gap = { height: nativeDefault.space.PX_16 };
let closure_11 = createStyles.createStyles(obj2);
const size = fn(2);
const result = size.fileFinishedImporting("components_native/channel_settings/ChannelSettingsInstantInvites.tsx");
2026-07-20 16:05:17 +00:00
export default function ConnectedChannelSettingsInstantInvites() {
let tmp = closure_11();
_require = tmp;
2026-07-29 08:29:29 +00:00
let tmp2 = importDefault;
let obj = dependencyMap;
[tmp4, importDefault] = invites(memo.useState(undefined), 2);
let items = [tmp];
2026-08-24 06:08:38 +00:00
let tmpResult = _require;
2026-07-23 10:11:24 +00:00
const callback = memo.useCallback((arg0) => {
importDefault(arg0 + gap.gap.height);
2026-07-20 16:05:17 +00:00
}, items);
const tmp3 = invites(memo.useState(undefined), 2);
2026-07-23 10:11:24 +00:00
const items1 = [memo1];
dependencyMap = require("initialize").useStateFromStores(items1, () => memo1.getChannel());
let obj2 = require("initialize");
2026-07-23 10:11:24 +00:00
const items2 = [memo1];
const stateFromStoresObject = require("initialize").useStateFromStoresObject(items2, () => memo1.getInvites());
2026-07-23 10:11:24 +00:00
invites = stateFromStoresObject.invites;
2026-07-20 16:05:17 +00:00
const loading = stateFromStoresObject.loading;
const items3 = [invites];
2026-07-23 10:11:24 +00:00
memo = memo.useMemo(() => {
2026-07-20 16:05:17 +00:00
const values = Object.values(invites);
return values.sort((inviter, inviter2) => {
inviter = inviter.inviter;
2026-07-29 08:29:29 +00:00
let str;
if (inviter != null) {
str = inviter.username;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (str == null) {
str = "";
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const formatted = str.toLowerCase();
2026-07-20 16:05:17 +00:00
inviter2 = inviter2.inviter;
2026-07-29 08:29:29 +00:00
let str2;
if (inviter2 != null) {
str2 = inviter2.username;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (str2 == null) {
str2 = "";
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return formatted.localeCompare(str2.toLowerCase());
2026-07-20 16:05:17 +00:00
});
}, items3);
const obj3 = require("initialize");
const items4 = [ChannelStore];
const stateFromStoresArray = require("initialize").useStateFromStoresArray(items4, () => {
if (null != id) {
const sortedLinkedChannelsForGuild = ChannelStore.getSortedLinkedChannelsForGuild(tmp.guild_id);
2026-07-29 08:29:29 +00:00
let found = sortedLinkedChannelsForGuild.filter((id) => id.id === id.id);
2026-07-20 16:05:17 +00:00
} else {
found = [];
}
return found;
});
const items5 = [memo, stateFromStoresArray];
2026-07-23 10:11:24 +00:00
memo1 = memo.useMemo(() => {
const items = [...memo.map((data) => ({ type: "invite", data })), ...stateFromStoresArray.map((data) => ({ type: "channel", data }))];
2026-07-20 16:05:17 +00:00
return items;
}, items5);
const items6 = [memo1.length];
2026-07-23 10:11:24 +00:00
const effect = memo.useEffect(() => {
require("ChannelSettingsActionCreators").setSection(constants.INSTANT_INVITES);
2026-07-20 16:05:17 +00:00
}, []);
const items7 = [memo1];
2026-07-23 10:11:24 +00:00
const callback1 = memo.useCallback((arg0, arg1) => {
2026-07-20 16:05:17 +00:00
if ("invite" === memo1[arg1].type) {
const obj2 = { invite: tmp.data };
let tmp5 = React7(InstantInviteDefault, obj2);
2026-07-20 16:05:17 +00:00
} else {
const obj = { channel: tmp.data };
tmp5 = React7(InstantInvite.LinkedChannelInvite, obj);
2026-07-20 16:05:17 +00:00
}
return tmp5;
}, items7);
if (!loading) {
if (0 === memo1.length) {
const obj5 = { lightSource: _modDef10981, darkSource: _modDef10982, title: null, body: null };
const intl = tmpResult(1114).intl;
obj5.title = intl.string(tmpResult(1114).t["+nLJkZ"]);
const intl2 = tmpResult(1114).intl;
obj5.body = intl2.string(tmpResult(1114).t.F53CAc);
return closure_9(tmpResult(1178).EmptyState, obj5);
2026-07-20 16:05:17 +00:00
}
}
if (!loading) {
2026-07-29 08:29:29 +00:00
if (null != tmp4) {
const obj6 = { style: tmp.content, children: null };
const obj7 = { sections: items6, estimatedListSize: "windowSize", itemSize: tmp4, renderItem: callback1, insetStart: tmp.gap.height, insetEnd: useSafeAreaInsetsDefault().bottom };
obj6.children = closure_9(FastestListDefault, obj7);
let tmp16Result = closure_9(stateFromStoresArray, obj6);
2026-07-20 16:05:17 +00:00
}
}
const obj8 = { style: tmp.content, children: null };
tmp = closure_9;
const items8 = [closure_9(tmpResult(7053).SceneLoadingIndicator, {}), ];
2026-07-29 08:29:29 +00:00
tmpResult = null;
2026-07-20 16:05:17 +00:00
if (memo1.length > 0) {
tmp2 = InstantInviteSelfMeasurerDefault;
2026-07-29 08:29:29 +00:00
obj = { item: null, onMeasured: null };
2026-07-20 16:05:17 +00:00
memo1 = memo1[0];
obj.item = memo1;
obj.onMeasured = callback;
2026-07-29 08:29:29 +00:00
tmpResult = tmp(tmp2, obj);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
items8[1] = tmpResult;
obj8.children = items8;
tmp16Result = closure_10(stateFromStoresArray, obj8);
2026-07-20 16:05:17 +00:00
};