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

508 lines
25 KiB
TypeScript

/* Metro module 9455; source: modules/hub/native/components/HubEmailConnectionGuildSelect.tsx; dependencies: [5, 57, 31, 27, 9445, 33, 4501, 697, 7972, 6819, 1418, 4573, 1244, 1585, 4578, 1305, 1484, 5277, 6998, 9450, 4131, 9444, 2] */
import Module00005 from '../../../../by-id/module-00005.js'; /* Metro dependency 5 */
import Module00057 from '../../../../by-id/module-00057.js'; /* Metro dependency 57 */
import UseSafeAreaInsetsNative from '../../../safe_area/useSafeAreaInsets.native.tsx'; /* Metro dependency 1585 */
import GuildIcon from '../../../guild/native/GuildIcon.tsx'; /* Metro dependency 6819 */
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 IndexNativeModule from '../../../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as GuildRecordUtilsModule from '../../../../utils/GuildRecordUtils.tsx'; /* Metro dependency 1418 */
import * as UseNavigationNativeModule from '../../../../design/components/Navigator/native/useNavigation.native.tsx'; /* Metro dependency 1484 */
import * as TextModule from '../../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
import * as ButtonNativeModule from '../../../../design/components/Button/native/Button.native.tsx'; /* Metro dependency 4578 */
import * as HeaderActionButtonNativeModule from '../../../../design/components/Navigator/native/HeaderActionButton.native.tsx'; /* Metro dependency 5277 */
import * as MagnifyingGlassIconModule from '../../../../design/components/Icon/native/redesign/generated/MagnifyingGlassIcon.tsx'; /* Metro dependency 6998 */
import * as NativeModule from '../../../../design/void/Form/native/index.tsx'; /* Metro dependency 7972 */
import * as HubEmailConnectionModalModule from './HubEmailConnectionModal.tsx'; /* Metro dependency 9444 */
import * as HubConstantsModule from '../../HubConstants.tsx'; /* Metro dependency 9445 */
function _fun73532(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#73532, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9641:6, offset: 0x01d705c0, size: 564 bytes, params: 8, frame: 22
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = ReactNativeModule;
const env0_6 = value.View;
const env0_7 = value.FlatList;
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;
object = {};
const object2 = {'marginHorizontal': 16, 'borderRadius': null, 'padding': 12};
object2.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
const BACKGROUND_MOD_NORMAL = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_MOD_NORMAL;
object2.backgroundColor = BACKGROUND_MOD_NORMAL;
object.rowContainer = object2;
const object3 = {};
object3.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
object.guildIcon = object3;
object.separator = {height: 8};
object.header = {'padding': 16, 'alignItems': 'center', 'justifyContent': 'center'};
object.title = {'marginBottom': 8, 'textAlign': 'center'};
const BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
object.footerSafeAreaContainer = {'backgroundColor': null, 'position': 'absolute', 'bottom': 0, 'width': '100%',
backgroundColor: BACKGROUND_BASE_LOW};
object.footerContainer = {'paddingHorizontal': 16, 'height': 110, 'justifyContent': 'center',
'alignItems': 'center'};
const RED_400 = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.RED_400;
object.error = {'color': null, 'alignSelf': 'center', 'fontSize': 14, 'marginVertical': 8, color: RED_400};
const env0_11 = Reflect.apply(createStyles, value, [object]);
const HubEmailConnectionGuildSelectRow2 = HubEmailConnectionGuildSelectRow;
(FileImportTrackerModule).fileFinishedImporting('modules/hub/native/components/HubEmailConnectionGuildSelect.tsx');
exports.default = HubEmailConnectionGuildSelect;
exports.HubEmailConnectionGuildSelectRow = HubEmailConnectionGuildSelectRow2;
function HubEmailConnectionGuildSelectRow({guildInfo, signup, loading}) { // fn#73533, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9641:884, offset: 0x01d707f4, size: 227 bytes, params: 2, frame: 23
const styles = useStyles();
const FormRow = (NativeModule).FormRow;
const formRowProps = {onPress: signup, disabled: loading, DEPRECATED_style: styles.rowContainer,
label: guildInfo.name};
const fromGuildBasic = GuildRecordUtilsModule.fromGuildBasic;
const object2 = {};
copyDataProperties(object2, guildInfo, undefined);
object2['features'] = [];
formRowProps.leading = ((Component) => <Component style={styles.guildIcon} guild={Reflect.apply(fromGuildBasic,
GuildRecordUtilsModule, [object2])} />)(GuildIcon);
const FormRow2 = (NativeModule).FormRow;
const Arrow = FormRow2.Arrow;
formRowProps.trailing = <Arrow />;
return <FormRow {...formRowProps} />;
}
function HubEmailConnectionGuildSelectHeader() { // fn#73534, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9641:1188, offset: 0x01d708d7, size: 153 bytes, params: 1, frame: 20
const styles = useStyles();
const Text = (TextModule).Text;
const intl = (IndexNativeModule).intl;
return (
<View style={styles.header}>
<Text
style={styles.title}
accessibilityRole="header"
variant="heading-xl/extrabold"
color="mobile-text-heading-primary"
>
{intl.string((IndexNativeModule).t.mOMeiR)}
</Text>
</View>
);
}
function HubEmailConnectionGuildSelectFooter({errors, loading, onFooterButtonPressed}) { // fn#73535, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9641:1454, offset: 0x01d70970, size: 341 bytes, params: 2, frame: 26
const styles = useStyles();
const bottom = (UseSafeAreaInsetsNative)().bottom;
const items2 = [styles.footerSafeAreaContainer];
items2[1] = {paddingBottom: bottom};
const Button = (ButtonNativeModule).Button;
const intl = (IndexNativeModule).intl;
const string = intl.string;
const G3Zk7V = (IndexNativeModule).t.G3Zk7V;
return (
<View style={items2}>
<View style={styles.footerContainer}>
<Button
variant="secondary"
loading={loading}
disabled={loading}
grow
text={Reflect.apply(string, intl, [G3Zk7V])}
onPress={onFooterButtonPressed}
/>
{errors != null && ((LegacyText) => <LegacyText style={styles.error}>{errors?.getAnyErrorMessage()}</LegacyText>)((require(1305) /* metro dependency 1305: native */).LegacyText)}
</View>
</View>
);
}
function HubEmailConnectionGuildSelect({onClose, email, guildsInfo}) { // fn#73536, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9641:1979, offset: 0x01d70ac5, size: 421 bytes, params: 2, frame: 25
const env0_3 = useStyles();
const value2 = (UseNavigationNativeModule).useNavigation();
const env0_4 = value2;
const binding = env0_5;
binding.useLayoutEffect(_fun73537, [email, guildsInfo, value2, onClose]);
const value3 = binding.useCallback(_fun73540, [email, value2, onClose]);
const bottom = (UseSafeAreaInsetsNative)().bottom;
let useState = binding.useState;
const value4 = Reflect.apply(useState, binding, [null]);
const binding2 = env0_4;
const value5 = binding2(value4, 2);
const property = value5[0];
var env0_5 = value5[1];
useState = binding.useState;
const value6 = binding2(Reflect.apply(useState, binding, [false]), 2);
const property2 = value6[0];
const env0_7 = value6[1];
const HubEmailConnectionScreen = (HubEmailConnectionModalModule).HubEmailConnectionScreen;
return (
<HubEmailConnectionScreen>
<FlatList
data={guildsInfo}
ListHeaderComponent={ListHeaderComponent}
renderItem={renderItem_73542}
ItemSeparatorComponent={ItemSeparatorComponent}
contentContainerStyle={{paddingBottom: 110 + bottom + 8}}
/>
<HubEmailConnectionGuildSelectFooter
errors={property}
loading={property2}
onFooterButtonPressed={value3}
/>
</HubEmailConnectionScreen>
);
function _fun73537() { // fn#73537, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9641:2108, offset: 0x01d70c6a, size: 38 bytes, params: 1, frame: 12
const binding = env0_4;
binding.setOptions({headerRight: headerRight_73538});
function headerRight_73538() { // fn#73538, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9641:2139, offset: 0x01d70c90, size: 131 bytes, params: 1, frame: 18
const HeaderActionButton = (HeaderActionButtonNativeModule).HeaderActionButton;
const object = {};
const MagnifyingGlassIcon = (MagnifyingGlassIconModule).MagnifyingGlassIcon;
object.IconComponent = MagnifyingGlassIcon;
object.onPress = onPress_73539;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
object.accessibilityLabel = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['5h0QOP']);
return <HeaderActionButton {...object} />;
function headerRight_73538OnPress() { // fn#73539, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9641:2225, owner: headerRight_73538.onPress, offset: 0x01d70d13, size: 64 bytes, params: 1, frame: 15
const binding = env2_4;
const push = binding.push;
const SELECT_SCHOOL_SEARCH = HubEmailConnectionSteps.SELECT_SCHOOL_SEARCH;
Reflect.apply(push, binding, [SELECT_SCHOOL_SEARCH, {email: email, onClose: onClose, guildsInfo: guildsInfo}]);
}
}
}
function _fun73540() { // fn#73540, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9641:2395, offset: 0x01d70d53, size: 55 bytes, params: 1, frame: 15
const binding = env0_4;
const push = binding.push;
const SUBMIT_SCHOOL = HubEmailConnectionSteps.SUBMIT_SCHOOL;
Reflect.apply(push, binding, [SUBMIT_SCHOOL, {email: email, onClose: onClose}]);
}
function HubEmailConnectionGuildSelectListHeaderComponent() { // fn#73541, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9641:2643, owner: HubEmailConnectionGuildSelect.ListHeaderComponent, offset: 0x01d70d8a, size: 23 bytes, params: 1, frame: 13
return <HubEmailConnectionGuildSelectHeader />;
}
function HubEmailConnectionGuildSelectRenderItem({item}) { // fn#73542, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9641:2700, owner: HubEmailConnectionGuildSelect.renderItem, offset: 0x01d70da1, size: 80 bytes, params: 2, frame: 16
const env0_0 = item.id;
return (
<HubEmailConnectionGuildSelectRow
guildInfo={item}
signup={env1_3(_fun73544)}
loading={env0_6}
/>
);
function* _fun73544() { // fn#73544, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9641:2786, offset: 0x01d70dfc, size: 258 bytes, params: 1, frame: 20
var value;
var value2;
var value3;
var binding;
var binding2;
var property;
var value4;
var sendVerificationEmail;
var value5;
var onCloseBinding;
var value6;
var value7;
var value8;
var push;
var binding3;
var VERIFY_PIN;
var object;
var error;
var binding4;
var binding5;
var value9;
var APIError;
var prototype;
var aPIError;
var value11;
exceptionLanding46: while (true) {
value = undefined;
value2 = false;
if (value2) {
return value;
}
value = environment.__proto__.__proto__;
env2_5(null);
FlatList(true);
value3 = environment.__proto__.__proto__.__proto__;
reducibleJoin4: while (true) {
reduciblePort45: while (true) {
exceptionLanding30: while (true) {
try {
try {
binding = env3_1;
} catch (error) {
break exceptionLanding30;
}
} catch (error) {
break exceptionLanding46;
}
break reducibleJoin4;
}
try {
binding = env2_5;
} catch (error) {
break exceptionLanding46;
}
try {
binding4 = env3_0;
} catch (error) {
break exceptionLanding46;
}
try {
binding5 = env3_2;
} catch (error) {
break exceptionLanding46;
}
try {
property = binding5[20];
} catch (error) {
break exceptionLanding46;
}
try {
value9 = binding4(property);
} catch (error) {
break exceptionLanding46;
}
try {
APIError = value9.APIError;
} catch (error) {
break exceptionLanding46;
}
try {
prototype = APIError.prototype;
} catch (error) {
break exceptionLanding46;
}
try {
} catch (error) {
break exceptionLanding46;
}
try {
aPIError = new APIError();
} catch (error) {
break exceptionLanding46;
}
try {
value11 = aPIError instanceof Object ? aPIError : undefined;
} catch (error) {
break exceptionLanding46;
}
try {
binding(value11);
} catch (error) {
break exceptionLanding46;
}
break reduciblePort45;
}
FlatList(false);
return undefined;
}
try {
try {
binding2 = env3_2;
} catch (error) {
break exceptionLanding30;
}
} catch (error) {
break exceptionLanding46;
}
try {
try {
property = binding2[19];
} catch (error) {
break exceptionLanding30;
}
} catch (error) {
break exceptionLanding46;
}
try {
try {
value4 = binding(property);
} catch (error) {
break exceptionLanding30;
}
} catch (error) {
break exceptionLanding46;
}
try {
try {
sendVerificationEmail = value4.sendVerificationEmail;
} catch (error) {
break exceptionLanding30;
}
} catch (error) {
break exceptionLanding46;
}
try {
try {
} catch (error) {
break exceptionLanding30;
}
} catch (error) {
break exceptionLanding46;
}
value5 = environment.__proto__;
try {
try {
onCloseBinding = onClose;
} catch (error) {
break exceptionLanding30;
}
} catch (error) {
break exceptionLanding46;
}
try {
try {
value6 = Reflect.apply(sendVerificationEmail, value4, [importDefault, true, onCloseBinding]);
} catch (error) {
break exceptionLanding30;
}
} catch (error) {
break exceptionLanding46;
}
yield value6;
try {
try {
value7 = undefined;
value8 = false;
} catch (error) {
break exceptionLanding30;
}
} catch (error) {
break exceptionLanding46;
}
if (value8) {
FlatList(false);
return value7;
}
try {
try {
binding = env2_4;
} catch (error) {
break exceptionLanding30;
}
} catch (error) {
break exceptionLanding46;
}
try {
try {
push = binding.push;
} catch (error) {
break exceptionLanding30;
}
} catch (error) {
break exceptionLanding46;
}
try {
try {
binding3 = env3_8;
} catch (error) {
break exceptionLanding30;
}
} catch (error) {
break exceptionLanding46;
}
try {
try {
VERIFY_PIN = binding3.VERIFY_PIN;
} catch (error) {
break exceptionLanding30;
}
} catch (error) {
break exceptionLanding46;
}
try {
try {
object = {};
} catch (error) {
break exceptionLanding30;
}
} catch (error) {
break exceptionLanding46;
}
try {
try {
} catch (error) {
break exceptionLanding30;
}
} catch (error) {
break exceptionLanding46;
}
try {
try {
object.email = importDefault;
} catch (error) {
break exceptionLanding30;
}
} catch (error) {
break exceptionLanding46;
}
try {
try {
} catch (error) {
break exceptionLanding30;
}
} catch (error) {
break exceptionLanding46;
}
try {
try {
object.onClose = require;
} catch (error) {
break exceptionLanding30;
}
} catch (error) {
break exceptionLanding46;
}
try {
try {
onCloseBinding = onClose;
} catch (error) {
break exceptionLanding30;
}
} catch (error) {
break exceptionLanding46;
}
try {
try {
object.guildId = onCloseBinding;
} catch (error) {
break exceptionLanding30;
}
} catch (error) {
break exceptionLanding46;
}
try {
try {
Reflect.apply(push, binding, [VERIFY_PIN, object]);
} catch (error) {
break exceptionLanding30;
}
} catch (error) {
break exceptionLanding46;
}
FlatList(false);
return undefined;
}
FlatList(false);
throw error;
}
}
function HubEmailConnectionGuildSelectItemSeparatorComponent() { // fn#73545, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9641:3011, owner: HubEmailConnectionGuildSelect.ItemSeparatorComponent, offset: 0x01d70efe, size: 40 bytes, params: 1, frame: 13
return <View style={styles.separator} />;
}
}
}
global.__d(_fun73532, 9455, [5, 57, 31, 27, 9445, 33, 4501, 697, 7972, 6819, 1418, 4573, 1244, 1585, 4578, 1305,
1484, 5277, 6998, 9450, 4131, 9444,
2]) /* metro module 9455, dependencies: [5, 57, 31, 27, 9445, 33, 4501, 697, 7972, 6819, 1418, 4573, 1244, 1585, 4578, 1305, 1484, 5277, 6998, 9450, 4131, 9444, 2] */;