99 lines
5.6 KiB
TypeScript
99 lines
5.6 KiB
TypeScript
/* Metro module 12655; source: modules/activate_device/native/UserCodeInput.tsx; dependencies: [57, 31, 27, 12656, 33, 4501, 12657, 12658, 4573, 1244, 7981, 4578, 2] */
|
|
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import ActivateDeviceSharedStyles from './ActivateDeviceSharedStyles.tsx'; /* Metro dependency 12658 */
|
|
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 JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
|
|
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
|
|
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 TextInputNativeModule from '../../../design/components/TextInput/native/TextInput.native.tsx'; /* Metro dependency 7981 */
|
|
import * as OAuthConstantsModule from '../../../external/discord_common/js/shared/shared-constants/OAuthConstants.tsx'; /* Metro dependency 12656 */
|
|
import * as UseUserCodeSubmitModule from '../useUserCodeSubmit.tsx'; /* Metro dependency 12657 */
|
|
|
|
function _fun97013(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#97013, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12845:6, offset: 0x0216fc5b, size: 262 bytes, params: 8, frame: 20
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_10 = (CreateStylesModule).createStyles({text: {textAlign: 'center'}});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/activate_device/native/UserCodeInput.tsx');
|
|
exports.UserCodeInput = UserCodeInput;
|
|
function UserCodeInput({onClose, onUserCodeAccepted, prefilledUserCode}) { // fn#97014, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12845:347, offset: 0x0216fd61, size: 695 bytes, params: 2, frame: 33
|
|
const styles = useStyles();
|
|
const useState = ReactModule.useState;
|
|
const value4 = Module00057(Reflect.apply(useState, ReactModule, [prefilledUserCode ?? '']), 2);
|
|
const property = value4[0];
|
|
const env0_0 = value4[1];
|
|
const {manualSubmit, error,
|
|
submitting} = (UseUserCodeSubmitModule).useUserCodeSubmit(property,
|
|
onUserCodeAccepted, onClose);
|
|
const jsxRuntimeEnv0_9Binding = jsxRuntimeEnv0_9;
|
|
const innerContent = (ActivateDeviceSharedStyles).innerContent;
|
|
const Text = (TextModule).Text;
|
|
const intl = (IndexNativeModule).intl;
|
|
let string = intl.string;
|
|
const t = (IndexNativeModule).t;
|
|
const KYPNUv = t.KYPNUv;
|
|
const items2 = [
|
|
<View style={innerContent}>
|
|
<Text
|
|
variant="heading-lg/bold"
|
|
color="mobile-text-heading-primary"
|
|
style={styles.text}
|
|
>
|
|
{Reflect.apply(string, intl, [KYPNUv])}
|
|
</Text>
|
|
<Text
|
|
variant="text-md/medium"
|
|
color="text-default"
|
|
style={styles.text}
|
|
>
|
|
{intl.string((IndexNativeModule).t.xRHk7f)}
|
|
</Text>
|
|
</View>,
|
|
];
|
|
const TextInput = (TextInputNativeModule).TextInput;
|
|
const object2 = {onChange: onChange_97015};
|
|
let USER_CODE_LENGTH = OAuthConstants.USER_CODE_LENGTH;
|
|
object2.maxLength = USER_CODE_LENGTH;
|
|
object2.value = property;
|
|
object2.autoFocus = true;
|
|
object2.autoComplete = 'off';
|
|
const formatToPlainString = intl.formatToPlainString;
|
|
const property2 = (IndexNativeModule).t['0tbz6x'];
|
|
USER_CODE_LENGTH = OAuthConstants.USER_CODE_LENGTH;
|
|
object2.placeholder = Reflect.apply(formatToPlainString, intl, [property2, {number: USER_CODE_LENGTH}]);
|
|
object2.errorMessage = error;
|
|
items2[1] = <TextInput {...object2} />;
|
|
const Button = (ButtonNativeModule).Button;
|
|
string = intl.string;
|
|
const length = property.length;
|
|
USER_CODE_LENGTH = OAuthConstants.USER_CODE_LENGTH;
|
|
items2[2] = (
|
|
<Button
|
|
size="lg"
|
|
text={Reflect.apply(string, intl, [t['3PatSz']])}
|
|
onPress={manualSubmit}
|
|
loading={submitting}
|
|
disabled={length !== USER_CODE_LENGTH}
|
|
grow
|
|
/>
|
|
);
|
|
return (
|
|
<>
|
|
{items2}
|
|
</>
|
|
);
|
|
function UserCodeInputOnChange(a0) { // fn#97015, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12845:903, owner: UserCodeInput.onChange, offset: 0x00c3fb7a, size: 19 bytes, params: 2, frame: 11
|
|
return env0_0(a0);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun97013, 12655, [57, 31, 27, 12656, 33, 4501, 12657, 12658, 4573, 1244, 7981, 4578,
|
|
2]) /* metro module 12655, dependencies: [57, 31, 27, 12656, 33, 4501, 12657, 12658, 4573, 1244, 7981, 4578, 2] */;
|