decord/source/modules/user_profile/native/UserProfileEditNote.tsx

127 lines
4.1 KiB
TypeScript
Raw Normal View History

// Module ID: 13151
// Function ID: 13152
2026-07-20 16:05:17 +00:00
// Name: UserProfileEditNote
// Dependencies: [32, 19, 17, 1074, 21, 4606, 1483, 13145, 5675, 11015, 4472, 7936, 1114, 13152, 4602, 7158, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
// Module 13151 (UserProfileEditNote)
import NavigatorHeader from "NavigatorHeader" /* 5675 */;
import _slicedToArray from "module_32" /* 32 */;
import noop from "module_19" /* 19 */;
2026-07-23 10:11:24 +00:00
require = fn;
const ScrollView = fn(17).ScrollView;
const NOTE_MAX_LENGTH = fn(1074).NOTE_MAX_LENGTH;
const jsxProd = fn(21);
({ jsx: closure_7, jsxs: closure_8 } = jsxProd);
const createStyles = fn(4606);
let closure_9 = createStyles.createStyles({ contentContainer: { paddingVertical: 24, paddingHorizontal: 16, gap: 8 } });
const size = fn(2);
const result = size.fileFinishedImporting("modules/user_profile/native/UserProfileEditNote.tsx");
2026-07-20 16:05:17 +00:00
export default function UserProfileEditNote(userId) {
userId = userId.userId;
const onSave = userId.onSave;
const onClose = userId.onClose;
let flag = userId.shouldFocusInput;
if (flag === undefined) {
flag = false;
}
let maxLength;
closure_7 = undefined;
let ref;
const tmp = closure_9();
const navigation = userId(onClose[6]).useNavigation();
2026-07-29 08:29:29 +00:00
const tmp5 = onSave(onClose[7])(userId);
const note = tmp5.note;
2026-07-29 08:29:29 +00:00
let str = note;
if (note == null) {
str = "";
2026-07-20 16:05:17 +00:00
}
const tmp6 = flag(navigation.useState(str), 2);
maxLength = tmp6[0];
closure_7 = tmp8;
ref = obj2.useRef(null);
const items = [flag];
const effect = obj2.useEffect(() => {
if (flag) {
const current = ref.current;
if (current != null) {
current.focus();
}
}
}, items);
const items1 = [navigation, userId, note, maxLength, onSave, onClose];
const layoutEffect = obj2.useLayoutEffect(() => {
2026-08-24 06:08:38 +00:00
let obj = {
headerLeft: NavigatorHeader.getHeaderConditionalBackButton(() => new Promise((arg0) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
let str = closure_5;
if (closure_5 == null) {
2026-08-24 06:08:38 +00:00
str = "";
}
const tmp2 = closure_1_1(11015);
2026-08-24 06:08:38 +00:00
tmp2({
hasEdits: str !== closure_6,
onHasEdits: closure_1_0(4472).dismissKeyboard,
2026-08-24 06:08:38 +00:00
resetPending() {
let str = closure_1_5;
if (closure_1_5 == null) {
2026-08-24 06:08:38 +00:00
str = "";
}
return closure_1_7(str);
2026-08-24 06:08:38 +00:00
},
onConfirm() {
closure_0(true);
if (dependencyMap != null) {
dependencyMap();
2026-08-24 06:08:38 +00:00
}
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
});
})),
headerRight(arg0) {
const obj = {};
const merged = Object.assign(arg0);
const intl = userId(onClose[12]).intl;
obj.label = intl.string(userId(onClose[12]).t["R3BPH+"]);
let str = note;
if (note == null) {
2026-08-24 06:08:38 +00:00
str = "";
2026-07-20 16:05:17 +00:00
}
obj.disabled = str === first;
2026-08-24 06:08:38 +00:00
obj.onPress = function onPress() {
onSave(onClose[13]).updateNote(closure_1_0, closure_1_6);
if (closure_1_1 != null) {
closure_1_1();
2026-08-24 06:08:38 +00:00
}
if (closure_1_2 != null) {
closure_1_2();
2026-08-24 06:08:38 +00:00
}
};
return closure_7(userId(onClose[11]).HeaderTextButton, obj);
2026-07-20 16:05:17 +00:00
}
};
navigation.setOptions(obj);
}, items1);
const obj3 = { contentContainerStyle: tmp.contentContainer, keyboardShouldPersistTaps: "always", children: null };
const obj4 = { variant: "text-sm/semibold", children: null };
2026-07-29 08:29:29 +00:00
let intl = tmp2(tmp3[12]).intl;
obj4.children = intl.string(userId(onClose[12]).t["mQKv+v"]);
const items2 = [closure_7(userId(onClose[14]).Text, obj4), ];
const obj5 = { ref, value: maxLength, onChange: tmp6[1], maxLength, autoCorrect: false, autoCapitalize: "none", placeholder: null, accessibilityLabel: null };
2026-07-29 08:29:29 +00:00
const intl2 = tmp2(tmp3[12]).intl;
2026-07-20 16:05:17 +00:00
const string = intl2.string;
2026-07-29 08:29:29 +00:00
const t = tmp2(tmp3[12]).t;
if (tmp5.loading) {
2026-07-23 10:11:24 +00:00
let stringResult = string(t["WLKx/9"]);
2026-07-20 16:05:17 +00:00
} else {
stringResult = string(t.tRZR6T);
}
obj5.placeholder = stringResult;
2026-07-29 08:29:29 +00:00
const intl3 = tmp2(tmp3[12]).intl;
obj5.accessibilityLabel = intl3.string(userId(onClose[12]).t["mQKv+v"]);
items2[1] = closure_7(userId(onClose[15]).TextArea, obj5);
obj3.children = items2;
return ref(note, obj3);
2026-07-20 16:05:17 +00:00
};