140 lines
9.0 KiB
TypeScript
140 lines
9.0 KiB
TypeScript
/* Metro module 10336; source: modules/user_profile/native/UserProfileEditNote.tsx; dependencies: [57, 31, 27, 661, 33, 4501, 1484, 10328, 5282, 8690, 4015, 9603, 1244, 10337, 4573, 7681, 2] */
|
|
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import MaybeShowDiscardChangesAlert from '../../user_settings/profiles/native/maybeShowDiscardChangesAlert.tsx'; /* Metro dependency 8690 */
|
|
import UseNote from '../hooks/useNote.tsx'; /* Metro dependency 10328 */
|
|
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 ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as UseNavigationNativeModule from '../../../design/components/Navigator/native/useNavigation.native.tsx'; /* Metro dependency 1484 */
|
|
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 TextAreaNativeModule from '../../../design/components/TextInput/native/TextArea.native.tsx'; /* Metro dependency 7681 */
|
|
import * as HeaderSharedModule from '../../main_tabs_v2/native/shared_components/HeaderShared.tsx'; /* Metro dependency 9603 */
|
|
|
|
function _fun80109(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#80109, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10522:6, offset: 0x01e6cc66, size: 258 bytes, params: 8, frame: 20
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_9 = (CreateStylesModule).createStyles({contentContainer: {'paddingVertical': 24,
|
|
'paddingHorizontal': 16, 'gap': 8}});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/user_profile/native/UserProfileEditNote.tsx');
|
|
exports.default = UserProfileEditNote;
|
|
function UserProfileEditNote({userId, onSave, onClose}) { // fn#80110, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10522:377, offset: 0x01e6cd68, size: 586 bytes, params: 2, frame: 26
|
|
const styles = useStyles();
|
|
const value2 = (UseNavigationNativeModule).useNavigation();
|
|
const env0_3 = value2;
|
|
const {loading, note} = (UseNote)(userId);
|
|
const note2 = note;
|
|
const binding = note2;
|
|
const useState = binding.useState;
|
|
const value6 = env0_3(Reflect.apply(useState, binding, [note ?? '']), 2);
|
|
const property = value6[0];
|
|
const property2 = value6[1];
|
|
note2.useLayoutEffect(_fun80111, [value2, userId, note, property, onSave, onClose]);
|
|
const Text = (TextModule).Text;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
let string = intl.string;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
const text = (
|
|
<Text variant="text-sm/semibold">
|
|
{Reflect.apply(string, intl, [t['mQKv+v']])}
|
|
</Text>
|
|
);
|
|
const TextArea = (TextAreaNativeModule).TextArea;
|
|
string = intl.string;
|
|
return (
|
|
<ScrollView contentContainerStyle={styles.contentContainer} keyboardShouldPersistTaps="always">
|
|
{text}
|
|
<TextArea
|
|
value={property}
|
|
onChange={property2}
|
|
maxLength={NOTE_MAX_LENGTH}
|
|
autoFocus
|
|
autoCorrect={false}
|
|
autoCapitalize="none"
|
|
placeholder={loading ? Reflect.apply(string, intl, [t['WLKx/9']]) : Reflect.apply(string, intl,
|
|
[t.tRZR6T])}
|
|
accessibilityLabel={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['mQKv+v'])}
|
|
/>
|
|
</ScrollView>
|
|
);
|
|
function _fun80111() { // fn#80111, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10522:583, offset: 0x01e6cfb2, size: 84 bytes, params: 1, frame: 16
|
|
var environment;
|
|
const binding = env0_3;
|
|
const setOptions = binding.setOptions;
|
|
const object = {};
|
|
let value = environment.__proto__;
|
|
object.headerLeft = (require(5282) /* metro dependency 5282: NavigatorHeaderNative */).getHeaderConditionalBackButton(function() {
|
|
var Promise = global.Promise;
|
|
var value = Object.create(Promise.prototype, {constructor: {value: Promise}});
|
|
var value2 = new Promise(_fun80113);
|
|
return value2 instanceof Object ? value2 : value;
|
|
});
|
|
object.headerRight = headerRight_80116;
|
|
Reflect.apply(setOptions, binding, [object]);
|
|
function _fun80112() { // fn#80112, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10522:653, offset: 0x01e6d006, size: 39 bytes, params: 1, frame: 11
|
|
const Promise = global.Promise;
|
|
const value = Object.create(Promise.prototype, {constructor: {value: Promise}});
|
|
const promise = new Promise(_fun80113);
|
|
return promise instanceof Object ? promise : value;
|
|
function _fun80113(a0) { // fn#80113, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10522:670, offset: 0x01e6d02d, size: 135 bytes, params: 2, frame: 16
|
|
const env0_0 = a0;
|
|
const defaultImport = MaybeShowDiscardChangesAlert;
|
|
const object = {};
|
|
object.hasEdits = (note ?? '') !== env2_5;
|
|
object.onHasEdits = (require(4015) /* metro dependency 4015: ChatInputUtils */).dismissKeyboard;
|
|
object.resetPending = resetPending;
|
|
object.onConfirm = onConfirm_80115;
|
|
defaultImport(object);
|
|
function resetPending() { // fn#80114, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10522:760, offset: 0x01e6d0b4, size: 37 bytes, params: 1, frame: 12
|
|
return env3_6(note ?? '');
|
|
}
|
|
|
|
function onConfirm_80115() { // fn#80115, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10522:790, offset: 0x01e6d0d9, size: 39 bytes, params: 1, frame: 12
|
|
env0_0(true);
|
|
if (onClose != null) {
|
|
onClose();
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function headerRight_80116(a0) { // fn#80116, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10522:834, offset: 0x01e6d100, size: 170 bytes, params: 2, frame: 18
|
|
var environment;
|
|
let value = environment.__proto__.__proto__;
|
|
const HeaderTextButton = (HeaderSharedModule).HeaderTextButton;
|
|
const headerTextButtonProps = {...a0};
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
headerTextButtonProps['label'] = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['R3BPH+']);
|
|
value = environment.__proto__;
|
|
headerTextButtonProps['disabled'] = (note ?? '') === env1_5;
|
|
headerTextButtonProps['onPress'] = headerRight_80116OnPress;
|
|
return <HeaderTextButton {...headerTextButtonProps} />;
|
|
function headerRight_80116OnPress() { // fn#80117, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10522:956, owner: headerRight_80116.onPress, offset: 0x01e6d1aa, size: 84 bytes, params: 1, frame: 15
|
|
let value = environment.__proto__.__proto__.__proto__;
|
|
value = importDefault(10337) /* metro dependency 10337: NoteActionCreators */;
|
|
value.updateNote(userId, env2_5);
|
|
if (onSave != null) {
|
|
onSave();
|
|
}
|
|
if (onClose != null) {
|
|
onClose();
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun80109, 10336, [57, 31, 27, 661, 33, 4501, 1484, 10328, 5282, 8690, 4015, 9603, 1244, 10337, 4573,
|
|
7681,
|
|
2]) /* metro module 10336, dependencies: [57, 31, 27, 661, 33, 4501, 1484, 10328, 5282, 8690, 4015, 9603, 1244, 10337, 4573, 7681, 2] */;
|