117 lines
6.3 KiB
TypeScript
117 lines
6.3 KiB
TypeScript
/* Metro module 11000; source: modules/reactions/native/EmojiReactionRowButton.tsx; dependencies: [31, 27, 1881, 33, 4501, 697, 4002, 5278, 1244, 7950, 1357, 6739, 1423, 3800, 2] */
|
|
function _fun84175(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#84175, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11186:6, offset: 0x01f3d22d, size: 271 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importAll(31) /* metro dependency 31 */;
|
|
(require(27) /* metro dependency 27 */).Platform;
|
|
const env0_4 = (require(1881) /* metro dependency 1881: EmojiConstants */).EMOJI_URL_BASE_SIZE;
|
|
const env0_5 = (require(33) /* metro dependency 33 */).jsx;
|
|
const env0_6 = (require(4501) /* metro dependency 4501: createStyles */).createStyles(function(a0) {
|
|
var object2 = {width: a0, height: a0, alignItems: 'center', justifyContent: 'center'};
|
|
object2.backgroundColor = importDefault(dependencyMap[5]).colors.MOBILE_EMOJI_BUTTON_BACKGROUND;
|
|
object2.borderRadius = importDefault(dependencyMap[5]).modules.button.BORDER_RADIUS;
|
|
object2.overflow = 'hidden';
|
|
return {emojiContainer: object2};
|
|
});
|
|
const env0_7 = (require(4501) /* metro dependency 4501: createStyles */).createStyles(_fun84177);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/reactions/native/EmojiReactionRowButton.tsx');
|
|
exports.EmojiPickerRowButton = EmojiPickerRowButton;
|
|
exports.EmojiReactionRowButton = EmojiReactionRowButton;
|
|
exports.getEmojiKey = function(a0, a1) {
|
|
return a0 == null ? a1 : a0.type === require(dependencyMap[13]).EmojiTypes.UNICODE ? a0.surrogates : a0.id;
|
|
};
|
|
}
|
|
|
|
function _fun84177(a0, a1, a2, a3) { // fn#84177, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11186:434, offset: 0x01f3d3ae, size: 130 bytes, params: 5, frame: 16
|
|
let value = a0;
|
|
const value2 = a2;
|
|
const r2 = a3 ? value2 : value;
|
|
const object2 = {};
|
|
object2.emojiImage = {width: value, height: value};
|
|
const object4 = {lineHeight: value2, fontSize: a1};
|
|
value = undefined;
|
|
const INTERACTIVE_TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.INTERACTIVE_TEXT_DEFAULT;
|
|
object4.color = INTERACTIVE_TEXT_DEFAULT;
|
|
object4.textAlign = 'center';
|
|
object4.width = r2;
|
|
object4.height = r2;
|
|
copyDataProperties(object4, a3 ? value : null, importDefault);
|
|
object2.emojiText = object4;
|
|
return object2;
|
|
}
|
|
|
|
function EmojiPickerRowButton({emojiContainerSize, onPress, iconSize, styles}) { // fn#84178, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11186:743, offset: 0x01f3d430, size: 323 bytes, params: 2, frame: 23
|
|
const styles2 = useStyles(emojiContainerSize);
|
|
const sharedModule = require(4002) /* metro dependency 4002: shared */;
|
|
const useThemeContext = sharedModule.useThemeContext;
|
|
const isThemeLight2 = sharedModule.isThemeLight(Reflect.apply(useThemeContext, sharedModule, []).theme);
|
|
const unsafe_rawColors = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors;
|
|
const r6 = isThemeLight2 ? unsafe_rawColors.PRIMARY_500 : unsafe_rawColors.PRIMARY_300;
|
|
const PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const string = intl.string;
|
|
const lfIHs4 = (require(1244) /* metro dependency 1244: indexNative */).t.lfIHs4;
|
|
const items2 = [styles2.emojiContainer, styles];
|
|
const ReactionIcon = (require(7950) /* metro dependency 7950: ReactionIcon */).ReactionIcon;
|
|
return (
|
|
<PressableOpacity
|
|
activeOpacity={0.5}
|
|
accessibilityRole="button"
|
|
accessibilityLabel={Reflect.apply(string, intl, [lfIHs4])}
|
|
hitSlop={4}
|
|
onPress={onPress}
|
|
style={items2}
|
|
>
|
|
<ReactionIcon color={r6} size={iconSize ?? 'md'} />
|
|
</PressableOpacity>
|
|
);
|
|
}
|
|
|
|
function EmojiReactionRowButton({emoji, emojiSize, emojiFontSize, emojiContainerSize, emojiLineHeight, onPress, styles}) { // fn#84179, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11186:1219, offset: 0x01f3d573, size: 474 bytes, params: 2, frame: 28
|
|
var r4;
|
|
var Emoji;
|
|
var id;
|
|
const styles2 = useStyles(emojiContainerSize);
|
|
const styles3 = useStyles(emojiSize, emojiFontSize, emojiLineHeight,
|
|
(importDefault(1357) /* metro dependency 1357: MobileVisualRefreshExperiment */)('EmojiReactionRowButton'));
|
|
const value4 = env0_3.useMemo(function() {
|
|
return {foreground: true};
|
|
}, []);
|
|
const PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const formatToPlainString = intl.formatToPlainString;
|
|
const property = (require(1244) /* metro dependency 1244: indexNative */).t['/iYSo6'];
|
|
const object = {};
|
|
object.emojiName = emoji?.name;
|
|
const items2 = [styles2.emojiContainer, styles];
|
|
if (emoji != null) {
|
|
Emoji = importDefault(6739) /* metro dependency 6739: Emoji */;
|
|
var defaultImport2Props = {textEmojiStyle: styles3.emojiText, fastImageStyle: styles3.emojiImage};
|
|
id = emoji.id;
|
|
defaultImport2Props.name = id == null ? emoji.surrogates : '';
|
|
id = emoji.id;
|
|
defaultImport2Props.src = id != null ? (importDefault(1423) /* metro dependency 1423: AvatarUtils */).getEmojiURL({id: emoji.id,
|
|
|
|
animated: emoji.animated, size: EMOJI_URL_BASE_SIZE}) : emoji.url;
|
|
r4 = <Emoji {...defaultImport2Props} />;
|
|
} else {
|
|
r4 = null;
|
|
}
|
|
return (
|
|
<PressableOpacity
|
|
androidRippleConfig={value4}
|
|
activeOpacity={0.5}
|
|
accessibilityRole="button"
|
|
accessibilityLabel={Reflect.apply(formatToPlainString, intl, [property, object])}
|
|
disabled={emoji == null}
|
|
hitSlop={4}
|
|
onPress={onPress}
|
|
style={items2}
|
|
>
|
|
{r4}
|
|
</PressableOpacity>
|
|
);
|
|
}
|
|
|