142 lines
8.0 KiB
TypeScript
142 lines
8.0 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] */
|
|
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});
|
|
const env0_4 = importDefault(5) /* metro dependency 5 */;
|
|
const env0_5 = importDefault(57) /* metro dependency 57 */;
|
|
const env0_6 = importAll(31) /* metro dependency 31 */;
|
|
let value = require(27) /* metro dependency 27 */;
|
|
const env0_7 = value.View;
|
|
const env0_8 = value.ScrollView;
|
|
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
|
|
value = require(8955) /* metro dependency 8955: ChangeEmailStore */;
|
|
const env0_10 = value.useChangeEmailError;
|
|
const env0_11 = value.useChangeEmailStore;
|
|
const env0_12 = value.ChangeEmailFields;
|
|
const env0_13 = (require(661) /* metro dependency 661: Constants */).AnalyticEvents;
|
|
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 = (importDefault(697) /* metro dependency 697: 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}}]);
|
|
(require(2) /* metro dependency 2 */).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 = (require(4573) /* metro dependency 4573: Text */).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 = (require(1484) /* metro dependency 1484: useNavigationNative */).useNavigation();
|
|
const currentUser = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
|
|
return UserStore.getCurrentUser();
|
|
});
|
|
const binding = env0_6;
|
|
const value3 = binding.useState('');
|
|
const binding2 = env0_5;
|
|
const value4 = binding2(value3, 2);
|
|
const property = value4[0];
|
|
const property2 = value4[1];
|
|
const EMAIL = ChangeEmailFields.EMAIL;
|
|
const value5 = binding2(useChangeEmailError(EMAIL), 2);
|
|
const property3 = value5[0];
|
|
const value7 = binding.useCallback(_fun70081, [value2, currentUser, value5[1], property,
|
|
useChangeEmailStore().emailToken, binding.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 _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 = (require(676) /* metro dependency 676: ConstantsIOS */).VerificationModalScenes;
|
|
const VERIFY_PASSWORD = VerificationModalScenes.VERIFY_PASSWORD;
|
|
const env0_0 = env1_4(_fun70083);
|
|
Reflect.apply(push, binding, [VERIFY_PASSWORD, {onSubmit: onSubmit, 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 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);
|
|
}
|
|
}
|
|
|