206 lines
11 KiB
TypeScript
206 lines
11 KiB
TypeScript
/* Metro module 15183; source: components_native/channel_settings/ChannelSettingsInstantInvites.tsx; dependencies: [57, 31, 27, 8149, 1379, 661, 33, 4501, 697, 1585, 566, 8148, 12132, 1305, 12146, 12147, 1244, 5460, 15184, 8671, 2] */
|
|
function _fun115996(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#115996, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15380:6, offset: 0x02477699, size: 359 bytes, params: 8, frame: 23
|
|
var object3;
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(57) /* metro dependency 57 */;
|
|
const env0_4 = importAll(31) /* metro dependency 31 */;
|
|
const env0_5 = (require(27) /* metro dependency 27 */).View;
|
|
const channelSettingsStore = importDefault(8149) /* metro dependency 8149: ChannelSettingsStore */;
|
|
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
|
|
const env0_8 = (require(661) /* metro dependency 661: Constants */).ChannelSettingsSections;
|
|
let value = require(33) /* metro dependency 33 */;
|
|
const env0_9 = value.jsx;
|
|
const env0_10 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object3 = {};
|
|
const object4 = {};
|
|
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object4.paddingHorizontal = PX_16;
|
|
const BACKGROUND_BASE_LOWER = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWER;
|
|
object4.backgroundColor = BACKGROUND_BASE_LOWER;
|
|
object4.flex = 1;
|
|
object3.content = object4;
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object3.gap = {height: PX_16};
|
|
const env0_11 = Reflect.apply(createStyles, value, [object3]);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('components_native/channel_settings/ChannelSettingsInstantInvites.tsx');
|
|
exports.default = ConnectedChannelSettingsInstantInvites;
|
|
}
|
|
|
|
function ConnectedChannelSettingsInstantInvites() { // fn#115997, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15380:494, offset: 0x02477800, size: 845 bytes, params: 1, frame: 29
|
|
var r7;
|
|
var r1;
|
|
var r0;
|
|
var EmptyState;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
var items2;
|
|
var value;
|
|
const styles = useStyles();
|
|
const bottom = (importDefault(1585) /* metro dependency 1585: useSafeAreaInsetsNative */)().bottom;
|
|
const binding = env0_4;
|
|
const [property, env0_1] = env0_3(binding.useState(undefined), 2);
|
|
const value4 = binding.useCallback(_fun115998, [styles]);
|
|
const env0_2 = (require(566) /* metro dependency 566: flux */).useStateFromStores([ChannelSettingsStore],
|
|
function() {
|
|
return ChannelSettingsStore.getChannel();
|
|
});
|
|
const {invites,
|
|
loading} = (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([ChannelSettingsStore],
|
|
function() {
|
|
return ChannelSettingsStore.getInvites();
|
|
});
|
|
const value8 = binding.useMemo(_fun116005, [binding.useMemo(_fun116001, [invites]),
|
|
(require(566) /* metro dependency 566: flux */).useStateFromStoresArray([ChannelStore], _fun116003)]);
|
|
items = [value8.length];
|
|
binding.useEffect(function() {
|
|
importDefault(dependencyMap[11]).setSection(ChannelSettingsSections.INSTANT_INVITES);
|
|
}, []);
|
|
const value9 = binding.useCallback(_fun116009, [value8]);
|
|
if (loading) {
|
|
if (loading) {
|
|
var viewBindingProps = {style: styles.content};
|
|
items2 = [((SceneLoadingIndicator) => <SceneLoadingIndicator />)((require(5460) /* metro dependency 5460: SceneLoadingIndicatorNative */).SceneLoadingIndicator)];
|
|
if (value8.length > 0) {
|
|
value = importDefault(15184) /* metro dependency 15184: InstantInviteSelfMeasurer */;
|
|
value = ((Component) => <Component item={value8[0]} onMeasured={value4} />)(value);
|
|
r7 = value;
|
|
} else {
|
|
r7 = null;
|
|
}
|
|
items2[1] = r7;
|
|
value = <View {...viewBindingProps}>{items2}</View>;
|
|
r1 = value;
|
|
} else if (property == null) {
|
|
var viewBindingProps = {style: styles.content};
|
|
items2 = [((SceneLoadingIndicator) => <SceneLoadingIndicator />)((require(5460) /* metro dependency 5460: SceneLoadingIndicatorNative */).SceneLoadingIndicator)];
|
|
if (value8.length > 0) {
|
|
value = importDefault(15184) /* metro dependency 15184: InstantInviteSelfMeasurer */;
|
|
value = ((Component) => <Component item={value8[0]} onMeasured={value4} />)(value);
|
|
r7 = value;
|
|
} else {
|
|
r7 = null;
|
|
}
|
|
items2[1] = r7;
|
|
value = <View {...viewBindingProps}>{items2}</View>;
|
|
r1 = value;
|
|
} else {
|
|
var viewBindingProps = {style: styles.content};
|
|
value = importDefault(8671) /* metro dependency 8671: FastestListAndroid */;
|
|
value = <View {...viewBindingProps}>{((Component) => <Component sections={items} estimatedListSize="windowSize" itemSize={property} renderItem={value9} insetStart={styles.gap.height} insetEnd={bottom} />)(value)}</View>;
|
|
r1 = value;
|
|
}
|
|
r0 = r1;
|
|
} else if (value8.length !== 0) {
|
|
if (loading) {
|
|
var viewBindingProps = {style: styles.content};
|
|
items2 = [((SceneLoadingIndicator) => <SceneLoadingIndicator />)((require(5460) /* metro dependency 5460: SceneLoadingIndicatorNative */).SceneLoadingIndicator)];
|
|
if (value8.length > 0) {
|
|
value = importDefault(15184) /* metro dependency 15184: InstantInviteSelfMeasurer */;
|
|
value = ((Component) => <Component item={value8[0]} onMeasured={value4} />)(value);
|
|
r7 = value;
|
|
} else {
|
|
r7 = null;
|
|
}
|
|
items2[1] = r7;
|
|
value = <View {...viewBindingProps}>{items2}</View>;
|
|
r1 = value;
|
|
} else if (property == null) {
|
|
var viewBindingProps = {style: styles.content};
|
|
items2 = [((SceneLoadingIndicator) => <SceneLoadingIndicator />)((require(5460) /* metro dependency 5460: SceneLoadingIndicatorNative */).SceneLoadingIndicator)];
|
|
if (value8.length > 0) {
|
|
value = importDefault(15184) /* metro dependency 15184: InstantInviteSelfMeasurer */;
|
|
value = ((Component) => <Component item={value8[0]} onMeasured={value4} />)(value);
|
|
r7 = value;
|
|
} else {
|
|
r7 = null;
|
|
}
|
|
items2[1] = r7;
|
|
value = <View {...viewBindingProps}>{items2}</View>;
|
|
r1 = value;
|
|
} else {
|
|
var viewBindingProps = {style: styles.content};
|
|
value = importDefault(8671) /* metro dependency 8671: FastestListAndroid */;
|
|
value = <View {...viewBindingProps}>{((Component) => <Component sections={items} estimatedListSize="windowSize" itemSize={property} renderItem={value9} insetStart={styles.gap.height} insetEnd={bottom} />)(value)}</View>;
|
|
r1 = value;
|
|
}
|
|
r0 = r1;
|
|
} else {
|
|
EmptyState = (require(1305) /* metro dependency 1305: native */).EmptyState;
|
|
r0 = <EmptyState lightSource={importDefault(12146) /* metro dependency 12146 */} darkSource={importDefault(12147) /* metro dependency 12147 */} title={intl.string(t['+nLJkZ'])} body={intl.string(t.F53CAc)} />;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun115998(a0) { // fn#115998, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15380:634, offset: 0x02477b4d, size: 37 bytes, params: 2, frame: 11
|
|
env0_1(a0 + styles.gap.height);
|
|
}
|
|
|
|
function _fun116001() { // fn#116001, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15380:818, offset: 0x02477b97, size: 47 bytes, params: 1, frame: 11
|
|
const Object = global.Object;
|
|
return Object.values(invites).sort(function(a0, a1) {
|
|
var r2;
|
|
var property = a0.inviter;
|
|
var value = undefined;
|
|
r2 = property == null ? value : property.username;
|
|
var value2 = '';
|
|
var value3 = (r2 ?? value2).toLowerCase();
|
|
property = a1.inviter;
|
|
return value3.localeCompare(((property == null ? value : property.username) ?? value2).toLowerCase());
|
|
});
|
|
}
|
|
|
|
function _fun116003() { // fn#116003, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15380:1082, offset: 0x02477c34, size: 67 bytes, params: 1, frame: 12
|
|
var environment;
|
|
var r0;
|
|
var value2;
|
|
var value;
|
|
if (channel != null) {
|
|
value2 = environment.__proto__;
|
|
value = ChannelStore.getSortedLinkedChannelsForGuild(channel.guild_id);
|
|
value = value.filter(function({id}) {
|
|
return id === channel.id;
|
|
});
|
|
r0 = value;
|
|
} else {
|
|
r0 = [];
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun116005() { // fn#116005, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15380:1183, offset: 0x02477c91, size: 69 bytes, params: 1, frame: 15
|
|
let binding = env0_4;
|
|
const value2 = binding.map(function(a0) {
|
|
return {type: 'invite', data: a0};
|
|
});
|
|
const items2 = [];
|
|
const value3 = arraySpread(items2, value2, 0, binding);
|
|
binding = env0_5;
|
|
arraySpread(items2, binding.map(function(a0) {
|
|
return {type: 'channel', data: a0};
|
|
}), value3, binding);
|
|
return items2;
|
|
}
|
|
|
|
function _fun116009(a0, a1) { // fn#116009, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15380:1375, offset: 0x02477d2c, size: 130 bytes, params: 3, frame: 15
|
|
var r0;
|
|
var value;
|
|
const property = env0_6[a1];
|
|
if (property.type === 'invite') {
|
|
value = environment.__proto__;
|
|
value = importDefault(12132) /* metro dependency 12132: InstantInvite */;
|
|
value = ((Component) => <Component invite={property.data} />)(value);
|
|
r0 = value;
|
|
} else {
|
|
value = environment.__proto__;
|
|
const LinkedChannelInvite = (require(12132) /* metro dependency 12132: InstantInvite */).LinkedChannelInvite;
|
|
value = <LinkedChannelInvite channel={property.data} />;
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|