128 lines
7.2 KiB
TypeScript
128 lines
7.2 KiB
TypeScript
/* Metro module 11748; source: modules/polls/native/ImageInputActionSheet.tsx; dependencies: [31, 27, 7217, 33, 4501, 697, 11747, 4015, 4080, 6805, 4573, 1305, 6807, 1244, 11749, 2] */
|
|
import UseRenderPollAnswerImage from './useRenderPollAnswerImage.tsx'; /* Metro dependency 11747 */
|
|
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 NativeModule from '../../../design/void/native.tsx'; /* Metro dependency 1305 */
|
|
import * as ActionSheetNativeModule from '../../../design/components/Sheet/native/ActionSheet.native.tsx'; /* Metro dependency 6805 */
|
|
import * as ActionSheetRowNativeModule from '../../../design/components/Sheet/native/ActionSheetRow.native.tsx'; /* Metro dependency 6807 */
|
|
import * as PollsConstantsModule from '../PollsConstants.tsx'; /* Metro dependency 7217 */
|
|
import * as EditPollCreationImageAltTextModalActionCreatorsModule from './EditPollCreationImageAltTextModalActionCreators.tsx'; /* Metro dependency 11749 */
|
|
|
|
function _fun90043(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#90043, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11934:6, offset: 0x020280a8, size: 283 bytes, params: 8, frame: 21
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = JsxRuntimeModule;
|
|
const env0_6 = value.jsx;
|
|
const env0_7 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
const object2 = {marginRight: 12};
|
|
object2.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
|
|
const env0_8 = Reflect.apply(createStyles, value, [{emojiContainer: {'flexDirection': 'row', 'alignItems': 'center',
|
|
'marginHorizontal': 24}, emojiIcon: object2}]);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/polls/native/ImageInputActionSheet.tsx');
|
|
exports.default = ImageInputAnswerActionSheet;
|
|
function ImageInputAnswerActionSheet({channelId, index, answer, onSaveAltText, onRemoveAnswerImage, openExpressionPicker}) { // fn#90044, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11934:452, offset: 0x020281c3, size: 884 bytes, params: 2, frame: 35
|
|
var r5;
|
|
var items3;
|
|
var Text;
|
|
const styles = useStyles();
|
|
const defaultImport = UseRenderPollAnswerImage;
|
|
const localCreationAnswerId = answer.localCreationAnswerId;
|
|
let image = answer.image;
|
|
const {renderImage, upload} = defaultImport(channelId, localCreationAnswerId, image, 40, 40);
|
|
const r12 = upload != null || answer.image?.emoji != null;
|
|
const env0_6 = onSaveAltText.useCallback(function() {
|
|
require(dependencyMap[7]).dismissKeyboard();
|
|
importDefault(dependencyMap[8]).hideActionSheet(POLL_CREATION_IMAGE_INPUT_ACTION_SHEET_KEY);
|
|
}, []);
|
|
const ActionSheet = (ActionSheetNativeModule).ActionSheet;
|
|
if (r12) {
|
|
var viewBindingProps = {style: styles.emojiContainer};
|
|
items3 = [
|
|
<View style={styles.emojiIcon}>
|
|
{renderImage}
|
|
</View>,
|
|
];
|
|
Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
image = answer.image;
|
|
items3[1] = (
|
|
<Text variant="text-md/bold" color="mobile-text-heading-primary">
|
|
{':' + (image == null || image.emoji == null ? undefined : image.emoji.name) + ':'}
|
|
</Text>
|
|
);
|
|
r5 = (
|
|
<View {...viewBindingProps}>
|
|
{items3}
|
|
</View>
|
|
);
|
|
} else {
|
|
r5 = r12;
|
|
}
|
|
const items2 = [r5];
|
|
const Spacer = (NativeModule).Spacer;
|
|
items2[1] = <Spacer size={21} />;
|
|
const ActionSheetRow = (ActionSheetRowNativeModule).ActionSheetRow;
|
|
const Group = ActionSheetRow.Group;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const string = intl.string;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
items2[2] = (
|
|
<Group hasIcons={false}>
|
|
<ActionSheetRow
|
|
label={r12 ? Reflect.apply(string, intl, [t.CZeRhU]) : Reflect.apply(string, intl, [t.dzcU1Q])}
|
|
onPress={onPress_90046}
|
|
/>
|
|
{
|
|
upload != null
|
|
? (
|
|
<ActionSheetRow
|
|
label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.w7x2t4)}
|
|
onPress={onPress_90047}
|
|
/>
|
|
)
|
|
: null
|
|
}
|
|
{
|
|
r12
|
|
? (
|
|
<ActionSheetRow
|
|
label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.IhMxgu)}
|
|
onPress={onPress_90048}
|
|
/>
|
|
)
|
|
: null
|
|
}
|
|
</Group>
|
|
);
|
|
return (
|
|
<ActionSheet startExpanded>
|
|
{items2}
|
|
</ActionSheet>
|
|
);
|
|
function ImageInputAnswerActionSheetOnPress() { // fn#90046, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11934:1296, owner: ImageInputAnswerActionSheet.onPress, offset: 0x0202857b, size: 23 bytes, params: 1, frame: 10
|
|
env0_6();
|
|
openExpressionPicker();
|
|
}
|
|
|
|
function ImageInputAnswerActionSheetOnPress_90047() { // fn#90047, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11934:1401, owner: ImageInputAnswerActionSheet.onPress, offset: 0x02028592, size: 93 bytes, params: 1, frame: 14
|
|
env0_6();
|
|
(EditPollCreationImageAltTextModalActionCreatorsModule).openEditPollCreationImageAltTextModal({channelId: channelId,
|
|
answer: answer, index: index, onSave: onSaveAltText, imageSize: 40});
|
|
}
|
|
|
|
function ImageInputAnswerActionSheetOnPress_90048() { // fn#90048, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11934:1602, owner: ImageInputAnswerActionSheet.onPress, offset: 0x020285ef, size: 28 bytes, params: 1, frame: 12
|
|
onRemoveAnswerImage(index);
|
|
env0_6();
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun90043, 11748, [31, 27, 7217, 33, 4501, 697, 11747, 4015, 4080, 6805, 4573, 1305, 6807, 1244, 11749,
|
|
2]) /* metro module 11748, dependencies: [31, 27, 7217, 33, 4501, 697, 11747, 4015, 4080, 6805, 4573, 1305, 6807, 1244, 11749, 2] */;
|