126 lines
7.0 KiB
TypeScript
126 lines
7.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] */
|
|
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_3 = importDefault(57) /* metro dependency 57 */;
|
|
const env0_4 = importAll(31) /* metro dependency 31 */;
|
|
const env0_5 = (require(27) /* metro dependency 27 */).ScrollView;
|
|
const env0_6 = (require(661) /* metro dependency 661: Constants */).NOTE_MAX_LENGTH;
|
|
const value = require(33) /* metro dependency 33 */;
|
|
const env0_7 = value.jsx;
|
|
const env0_8 = value.jsxs;
|
|
const env0_9 = (require(4501) /* metro dependency 4501: createStyles */).createStyles({contentContainer: {'paddingVertical': 24,
|
|
'paddingHorizontal': 16, 'gap': 8}});
|
|
(require(2) /* metro dependency 2 */).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 = (require(1484) /* metro dependency 1484: useNavigationNative */).useNavigation();
|
|
const env0_3 = value2;
|
|
const {loading, note} = (importDefault(10328) /* metro dependency 10328: useNote */)(userId);
|
|
const env0_4 = note;
|
|
const binding = env0_4;
|
|
const useState = binding.useState;
|
|
const value6 = env0_3(Reflect.apply(useState, binding, [note ?? '']), 2);
|
|
const property = value6[0];
|
|
const property2 = value6[1];
|
|
env0_4.useLayoutEffect(_fun80111, [value2, userId, note, property, onSave, onClose]);
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).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 = (require(7681) /* metro dependency 7681: TextAreaNative */).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 object2 = {};
|
|
let value = environment.__proto__;
|
|
object2.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;
|
|
});
|
|
object2.headerRight = headerRight_80116;
|
|
Reflect.apply(setOptions, binding, [object2]);
|
|
}
|
|
|
|
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 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 = (require(9603) /* metro dependency 9603: HeaderShared */).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 _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 = importDefault(8690) /* metro dependency 8690: maybeShowDiscardChangesAlert */;
|
|
const object2 = {};
|
|
object2.hasEdits = (note ?? '') !== env2_5;
|
|
object2.onHasEdits = (require(4015) /* metro dependency 4015: ChatInputUtils */).dismissKeyboard;
|
|
object2.resetPending = resetPending;
|
|
object2.onConfirm = onConfirm_80115;
|
|
defaultImport(object2);
|
|
}
|
|
|
|
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();
|
|
}
|
|
}
|
|
|
|
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();
|
|
}
|
|
}
|
|
|