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

201 lines
11 KiB
TypeScript

/* Metro module 9007; source: modules/verification/native/components/EnterEmail.tsx; dependencies: [5, 57, 31, 27, 1878, 8955, 661, 33, 4501, 697, 1484, 566, 676, 9008, 683, 4573, 1244, 8967, 4578, 2] */
import Module00005 from '../../../../by-id/module-00005.js'; /* Metro dependency 5 */
import Module00057 from '../../../../by-id/module-00057.js'; /* Metro dependency 57 */
import Native from '../../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
import UserStore from '../../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
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 ConstantsModule from '../../../../Constants.tsx'; /* Metro dependency 661 */
import * as ConstantsIOSModule from '../../../../ConstantsIOS.tsx'; /* Metro dependency 676 */
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 */
function _fun70076(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#70076, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9192:6, offset: 0x01ced86b, size: 430 bytes, params: 8, frame: 21
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = ReactNativeModule;
const env0_7 = value.View;
const env0_8 = value.ScrollView;
value = require(8955) /* metro dependency 8955: ChangeEmailStore */;
const env0_10 = value.useChangeEmailError;
const env0_11 = value.useChangeEmailStore;
const env0_12 = value.ChangeEmailFields;
value = require(33) /* metro dependency 33 */;
const env0_14 = value.jsx;
const env0_15 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
const BACKGROUND_BASE_LOW = (Native).colors.BACKGROUND_BASE_LOW;
const env0_16 = Reflect.apply(createStyles, value, [{background: {backgroundColor: BACKGROUND_BASE_LOW},
container: {'paddingVertical': 12, 'paddingHorizontal': 16}, title: {textAlign: 'center'},
prompt: {'marginTop': 8, 'lineHeight': 18, 'textAlign': 'center'}, input: {'marginTop': 24,
'marginBottom': 16}}]);
(FileImportTrackerModule).fileFinishedImporting('modules/verification/native/components/EnterEmail.tsx');
exports.default = EnterEmail;
function EnterEmail({isChangeEmail, changeEmailReason}) { // fn#70077, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9192:660, offset: 0x01ceda19, size: 1109 bytes, params: 2, frame: 35
var r0;
const Text = (TextModule).Text;
var email;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
var string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
var Vm8akB;
var items2;
var FreeFormInputGroup;
var Button;
var value;
const styles = useStyles();
const value2 = (UseNavigationNativeModule).useNavigation();
const currentUser = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
return UserStore.getCurrentUser();
});
const value3 = ReactModule.useState('');
const value4 = Module00057(value3, 2);
const property = value4[0];
const property2 = value4[1];
const EMAIL = ChangeEmailFields.EMAIL;
const value5 = Module00057(useChangeEmailError(EMAIL), 2);
const property3 = value5[0];
const value7 = ReactModule.useCallback(_fun70081, [value2, currentUser, value5[1], property,
useChangeEmailStore().emailToken, ReactModule.useCallback(_fun70079, [value2]), isChangeEmail, changeEmailReason]);
if (currentUser == null) {
r0 = null;
} else {
var scrollViewBindingProps = {'style': null, 'keyboardShouldPersistTaps': 'handled',
'alwaysBounceVertical': false,
style: styles.background};
var viewBindingProps = {style: styles.container};
email = currentUser.email;
items2 = [
<Text
style={styles.title}
accessibilityRole="header"
variant="heading-xl/extrabold"
color="mobile-text-heading-primary"
>
{email != null ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t.Vm8akB) : intl.string((require(1244) /* metro dependency 1244: indexNative */).t['CDTD/K'])}
</Text>,
];
email = currentUser.email;
items2[1] = (
<Text
style={styles.prompt}
variant="text-sm/medium"
color="text-default"
>
{email != null ? intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.Z7CaI7,
{email: currentUser.email}) : intl.string((require(1244) /* metro dependency 1244: indexNative */).t.YXXMxK)}
</Text>
);
FreeFormInputGroup = importDefault(8967) /* metro dependency 8967: FreeFormInputGroup */;
items2[2] = (
<FreeFormInputGroup
style={styles.input}
label={intl.string(t['w/qqKK'])}
textContentType="emailAddress"
keyboardType="email-address"
value={property}
onChangeText={property2}
onSubmitEditing={value7}
placeholder={intl.string(t.dI4d4S)}
returnKeyType="done"
autoCapitalize="none"
error={property3}
autoFocus
/>
);
Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
string = intl.string;
Vm8akB = t.Vm8akB;
value = property === '';
items2[3] = (
<Button
text={Reflect.apply(string, intl, [Vm8akB])}
onPress={value7}
disabled={value || property === currentUser.email}
/>
);
value = (
<ScrollView {...scrollViewBindingProps}>
<View {...viewBindingProps}>
{items2}
</View>
</ScrollView>
);
r0 = value;
}
return r0;
function _fun70079(a0) { // fn#70079, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9192:926, offset: 0x01cede6e, size: 52 bytes, params: 2, frame: 11
const env0_0 = a0;
const binding = env0_2;
const getState = binding.getState;
return Reflect.apply(getState, binding, []).routes.findIndex(_fun70080);
function _fun70080({name}) { // fn#70080, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9192:960, offset: 0x00e6222e, size: 21 bytes, params: 2, frame: 2
return name === env0_0;
}
}
function _fun70081() { // fn#70081, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9192:999, offset: 0x01cedea2, size: 112 bytes, params: 1, frame: 17
const binding = env0_2;
const push = binding.push;
const VerificationModalScenes = (ConstantsIOSModule).VerificationModalScenes;
const VERIFY_PASSWORD = VerificationModalScenes.VERIFY_PASSWORD;
const env0_0 = env1_4(_fun70083);
Reflect.apply(push, binding, [VERIFY_PASSWORD, {onSubmit: onSubmit_70084, onSuccess: onSuccess_70085,
hideUnverifiedBanner: true}]);
function* _fun70083(a0) { // fn#70083, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9192:1082, offset: 0x01cedf1d, size: 130 bytes, params: 2, frame: 17
var r1;
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
const value3 = null;
if (value3 == dependencyMap) {
r1 = value3;
} else {
env2_5(value3);
var value5 = env3_2(env3_3[13]);
yield value5.saveEmail({email: env2_4, password: a0, emailToken: env2_6}, importAll, View);
value = undefined;
if (false) {
return value;
}
r1 = value;
}
return r1;
}
function onSubmit_70084() { // fn#70084, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9192:1192, offset: 0x00c3945f, size: 30 bytes, params: 1, frame: 13
return env0_0.apply(this, arguments);
}
function onSuccess_70085() { // fn#70085, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9192:1246, offset: 0x01cedf9f, size: 151 bytes, params: 1, frame: 18
var moduleValue;
var defaultImport;
var moduleValue2;
if (isChangeEmail) {
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
defaultImport.track(AnalyticEvents.USER_ACCOUNT_EMAIL_CHANGE_SAVE_NEW_EMAIL,
{change_email_reason_enum: changeEmailReason});
moduleValue2 = importAll(9008) /* metro dependency 9008: ChangeEmailUtils */;
moduleValue2.finishChangeEmailFlow(env1_2, env1_4);
} else {
moduleValue = importAll(9008) /* metro dependency 9008: ChangeEmailUtils */;
moduleValue.finishVerifyEmailFlow(env1_2, env1_7);
}
}
}
}
}
global.__d(_fun70076, 9007, [5, 57, 31, 27, 1878, 8955, 661, 33, 4501, 697, 1484, 566, 676, 9008, 683, 4573, 1244,
8967, 4578,
2]) /* metro module 9007, dependencies: [5, 57, 31, 27, 1878, 8955, 661, 33, 4501, 697, 1484, 566, 676, 9008, 683, 4573, 1244, 8967, 4578, 2] */;