99 lines
5.7 KiB
TypeScript
99 lines
5.7 KiB
TypeScript
/* Metro module 11747; source: modules/polls/native/useRenderPollAnswerImage.tsx; dependencies: [57, 31, 27, 4645, 4644, 1881, 33, 566, 11741, 5475, 6739, 3800, 1423, 2] */
|
|
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import UploadAttachmentStore from '../../../stores/UploadAttachmentStore.tsx'; /* Metro dependency 4644 */
|
|
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 FluxModule from '../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import * as EmojiConstantsModule from '../../emojis/EmojiConstants.tsx'; /* Metro dependency 1881 */
|
|
import * as DraftStoreModule from '../../../stores/DraftStore.tsx'; /* Metro dependency 4645 */
|
|
import * as PollTypesModule from '../PollTypes.tsx'; /* Metro dependency 11741 */
|
|
|
|
function _fun90039(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#90039, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11933:6, offset: 0x02027ce6, size: 240 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/polls/native/useRenderPollAnswerImage.tsx');
|
|
exports.default = useRenderPollAnswerImage;
|
|
function useRenderPollAnswerImage(a0, a1, a2, a3, a4) { // fn#90040, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11933:312, offset: 0x02027dd6, size: 279 bytes, params: 6, frame: 22
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
const env0_2 = a2;
|
|
const env0_3 = a3;
|
|
const env0_4 = a4;
|
|
const value2 = undefined;
|
|
const upload = (FluxModule).useStateFromStores([UploadAttachmentStore],
|
|
_fun90041);
|
|
let binding = env0_4;
|
|
const [property, property2] = env0_3(binding.useState(), 2);
|
|
const status = a2 == null || a2.mediaAttachmentState == null ? value2 : a2.mediaAttachmentState.status;
|
|
const PollMediaUploadAttachmentStatus = (PollTypesModule).PollMediaUploadAttachmentStatus;
|
|
const PREPARING = PollMediaUploadAttachmentStatus.PREPARING;
|
|
const value5 = status === PREPARING;
|
|
binding = env0_4;
|
|
const useMemo = binding.useMemo;
|
|
return {renderImage: Reflect.apply(useMemo, binding, [_fun90042, [a2, a4, a3, upload, value5, property]]),
|
|
upload: upload, setUploadSize: property2};
|
|
function _fun90041() { // fn#90041, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11933:397, offset: 0x02027eed, size: 43 bytes, params: 1, frame: 15
|
|
const uploadAttachmentStoreBinding = UploadAttachmentStore;
|
|
const getUpload = uploadAttachmentStoreBinding.getUpload;
|
|
const binding = env0_0;
|
|
const Poll = DraftType.Poll;
|
|
return Reflect.apply(getUpload, uploadAttachmentStoreBinding, [binding, require, Poll]);
|
|
}
|
|
|
|
function _fun90042() { // fn#90042, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11933:609, offset: 0x02027f18, size: 400 bytes, params: 1, frame: 22
|
|
var r7;
|
|
var r6;
|
|
var value3;
|
|
var Emoji;
|
|
var object;
|
|
var binding;
|
|
var item;
|
|
var value;
|
|
if (result) {
|
|
value = environment.__proto__;
|
|
return <ActivityIndicator />;
|
|
}
|
|
if (upload != null) {
|
|
item = upload.item;
|
|
r6 = importAll ?? DraftStoreModule.DraftType;
|
|
value = environment.__proto__;
|
|
value = importDefault(5475) /* metro dependency 5475: FastImage */;
|
|
return ((Component) => <Component style={{width: r6, height: r6}} source={{uri: item.uri}} />)(value);
|
|
}
|
|
const value2 = undefined;
|
|
let emoji = importDefault == null ? value2 : importDefault.emoji;
|
|
if (emoji != null) {
|
|
emoji = importDefault.emoji;
|
|
value3 = environment.__proto__;
|
|
Emoji = importDefault(6739) /* metro dependency 6739: Emoji */;
|
|
object = {};
|
|
binding = env0_4;
|
|
object.fastImageStyle = {width: binding, height: binding};
|
|
object.textEmojiStyle = {fontSize: binding};
|
|
r7 = emoji.type === (require(3800) /* metro dependency 3800: EmojiTypes */).EmojiTypes.UNICODE ? emoji.surrogates : emoji.name;
|
|
value = '';
|
|
r6 = r7 ?? value;
|
|
object.name = r6;
|
|
if (emoji.id != null) {
|
|
value = importDefault(1423) /* metro dependency 1423: AvatarUtils */;
|
|
value = value.getEmojiURL({id: emoji.id, animated: emoji.animated, size: EMOJI_URL_BASE_SIZE});
|
|
r6 = value;
|
|
} else {
|
|
r6 = value2;
|
|
}
|
|
object.src = r6;
|
|
return <Emoji {...object} />;
|
|
}
|
|
return value2;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun90039, 11747, [57, 31, 27, 4645, 4644, 1881, 33, 566, 11741, 5475, 6739, 3800, 1423,
|
|
2]) /* metro module 11747, dependencies: [57, 31, 27, 4645, 4644, 1881, 33, 566, 11741, 5475, 6739, 3800, 1423, 2] */;
|