decord/source/modules/image_upload/native/AddImageDescriptionModal.tsx

132 lines
5.4 KiB
TypeScript
Raw Normal View History

2026-08-27 16:17:25 +00:00
// Module ID: 10798
// Function ID: 10799
2026-07-20 16:05:17 +00:00
// Name: AddDescription
2026-08-27 16:17:25 +00:00
// Dependencies: [32, 19, 17, 4807, 4806, 21, 4445, 712, 589, 1494, 1500, 5546, 9134, 7540, 1236, 8095, 10797, 7741, 10581, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-27 16:17:25 +00:00
// Module 10798 (AddDescription)
2026-08-24 06:08:38 +00:00
import ThemesDefault from "Themes" /* 712 */;
import getSystemLocale from "getSystemLocale" /* 1236 */;
2026-08-27 16:17:25 +00:00
import _modDef10581 from "module_10581" /* 10581 */;
2026-08-24 06:08:38 +00:00
import closure_3 from "_slicedToArray" /* 32 */;
import closure_4 from "noop" /* 19 */;
import get_ActivityIndicator from "get ActivityIndicator" /* 17 */;
2026-08-27 16:17:25 +00:00
import { DraftType } from "handleChanged" /* 4807 */;
import closure_9 from "map" /* 4806 */;
2026-08-24 06:08:38 +00:00
import jsxProd from "jsxProd" /* 21 */;
2026-08-27 16:17:25 +00:00
import createCacheKey from "createCacheKey" /* 4445 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-07-20 16:05:17 +00:00
function AddDescription(id) {
({ source, channelId } = id);
id = id.id;
2026-07-29 08:29:29 +00:00
let stateFromStores;
2026-07-23 10:11:24 +00:00
let first;
2026-07-20 16:05:17 +00:00
let React;
let navigation;
2026-08-24 06:08:38 +00:00
const tmp = callback3();
2026-07-23 10:11:24 +00:00
let obj = channelId(stateFromStores[8]);
2026-08-24 06:08:38 +00:00
const items = [closure_9];
stateFromStores = obj.useStateFromStores(items, () => closure_1_9.getUpload(channelId, id, closure_1_8.ChannelMessage));
2026-07-20 16:05:17 +00:00
({ width, height } = source);
let num = 1;
if (null != width) {
num = 1;
if (null != height) {
num = 1;
if (0 !== width) {
num = 1;
if (0 !== height) {
num = width / height;
}
}
}
}
2026-08-24 06:08:38 +00:00
obj1 = React;
2026-07-29 08:29:29 +00:00
let str;
if (stateFromStores != null) {
str = stateFromStores.description;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (str == null) {
str = "";
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const tmp7 = first(React.useState(str), 2);
first = tmp7[0];
React = obj1.useRef(first);
const ref = obj1.useRef(null);
const ref1 = obj1.useRef(null);
const tmp6 = id(stateFromStores[9])({ ignoreKeyboard: true });
navigation = channelId(stateFromStores[10]).useNavigation();
const insets = tmp5(tmp3[11])({ includeKeyboardHeight: true }).insets;
2026-07-20 16:05:17 +00:00
const items1 = [{ ref, offset: { type: "toBottom" } }];
2026-07-23 10:11:24 +00:00
id(stateFromStores[12])({ insets, inputs: items1, scrollViewRef: ref1 });
2026-07-20 16:05:17 +00:00
const items2 = [first];
2026-07-29 08:29:29 +00:00
const effect = obj1.useEffect(() => {
2026-08-24 06:08:38 +00:00
closure_4.current = first;
2026-07-20 16:05:17 +00:00
}, items2);
const items3 = [channelId, id, stateFromStores, navigation];
2026-07-29 08:29:29 +00:00
const effect1 = obj1.useEffect(() => {
2026-07-20 16:05:17 +00:00
navigation.setOptions({
headerRight(arg0) {
2026-08-24 06:08:38 +00:00
let obj = closure_1_0(closure_1_2[13]);
const intl = closure_1_0(closure_1_2[14]).intl;
2026-07-20 16:05:17 +00:00
obj = {};
2026-08-24 06:08:38 +00:00
const renderHeaderTextButton = obj.getRenderHeaderTextButton(intl.string(closure_1_0(closure_1_2[14]).t["R3BPH+"]), () => {
let obj = closure_1_1(closure_1_2[15]);
2026-07-20 16:05:17 +00:00
obj = {};
2026-07-29 08:29:29 +00:00
const merged = Object.assign(closure_2);
obj.description = ref.current;
2026-08-24 06:08:38 +00:00
obj.update(closure_0, closure_1, closure_1_8.ChannelMessage, obj);
closure_1_1(closure_1_2[16]).close();
2026-07-20 16:05:17 +00:00
});
2026-07-23 10:11:24 +00:00
let merged = Object.assign(arg0);
2026-07-20 16:05:17 +00:00
return renderHeaderTextButton(obj);
}
});
}, items3);
2026-07-29 08:29:29 +00:00
obj = { ref: ref1, style: tmp.contentContainer, contentContainerStyle: null, children: null };
obj = { padding: tmp5(tmp3[7]).space.PX_16, paddingBottom: insets.bottom + tmp5(tmp3[7]).space.PX_16 };
obj[2] = obj;
2026-07-23 10:11:24 +00:00
obj1 = { style: tmp.imageContainer, children: callback(closure_6, { style: items4, source }) };
2026-07-29 08:29:29 +00:00
items4 = [tmp.image, { aspectRatio: num, maxHeight: tmp6.height / 2 }];
2026-07-23 10:11:24 +00:00
const items5 = [callback(navigation, obj1), ];
2026-07-29 08:29:29 +00:00
const obj2 = { ref, containerStyle: null, label: null, placeholder: null, value: null, onChange: null, placeholderTextColor: null, maxLength: 1000, autoFocus: true };
2026-08-24 06:08:38 +00:00
const tmp2Result = channelId(stateFromStores[10]);
obj2[1] = { paddingTop: id(stateFromStores[7]).space.PX_16 };
2026-07-29 08:29:29 +00:00
let intl = tmp2(tmp3[14]).intl;
obj2[2] = intl.string(channelId(stateFromStores[14]).t.eOB2eR);
const intl2 = tmp2(tmp3[14]).intl;
obj2[3] = intl2.string(channelId(stateFromStores[14]).t.RNH1jn);
obj2[4] = first;
obj2[5] = tmp7[1];
obj2[6] = tmp.placeholderText.color;
items5[1] = callback(channelId(stateFromStores[17]).TextArea, obj2);
obj[3] = items5;
2026-07-23 10:11:24 +00:00
return callback2(closure_7, obj);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
({ View: c5, Image: closure_6, ScrollView: error } = get_ActivityIndicator);
({ jsx: c10, jsxs: unpackModuleId } = jsxProd);
createCacheKey = { contentContainer: null, imageContainer: null, image: null, placeholderText: null };
2026-08-24 06:08:38 +00:00
createCacheKey = { backgroundColor: ThemesDefault.colors.BACKGROUND_BASE_LOW };
2026-07-29 08:29:29 +00:00
createCacheKey[0] = createCacheKey;
2026-08-24 06:08:38 +00:00
createCacheKey[1] = { alignItems: "center", borderRadius: ThemesDefault.radii.sm };
2026-08-25 06:04:03 +00:00
let obj2 = { width: "100%", resizeMode: "contain", height: "Array", borderRadius: true };
2026-08-24 06:08:38 +00:00
obj2[3] = ThemesDefault.radii.sm;
2026-07-29 08:29:29 +00:00
createCacheKey[2] = obj2;
2026-08-24 06:08:38 +00:00
let obj1 = { alignItems: "center", borderRadius: ThemesDefault.radii.sm };
createCacheKey[3] = { color: ThemesDefault.colors.TEXT_MUTED };
let closure_12 = createCacheKey.createStyles(createCacheKey);
const obj3 = { color: ThemesDefault.colors.TEXT_MUTED };
const result = require("set").fileFinishedImporting("modules/image_upload/native/AddImageDescriptionModal.tsx");
2026-07-20 16:05:17 +00:00
export default function AddImageDescriptionModal(arg0) {
2026-07-23 10:11:24 +00:00
({ source: require, channelId: importDefault, id: dependencyMap } = arg0);
2026-07-29 08:29:29 +00:00
const obj = { screenKey: "addImageDescriptionModal", title: null, render: null };
2026-08-24 06:08:38 +00:00
const intl = getSystemLocale.intl;
obj[1] = intl.string(getSystemLocale.t["5S2AK+"]);
2026-07-29 08:29:29 +00:00
obj[2] = function render() {
2026-08-24 06:08:38 +00:00
return closure_1_10(closure_1_13, { source: closure_0, channelId: closure_1, id: closure_2 });
2026-07-20 16:05:17 +00:00
};
2026-08-27 16:17:25 +00:00
return callback(_modDef10581, obj);
2026-07-20 16:05:17 +00:00
};