127 lines
7.4 KiB
TypeScript
127 lines
7.4 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] */
|
|
import Native from '../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
|
|
import MobileVisualRefreshExperiment from '../../themes/experiments/MobileVisualRefreshExperiment.tsx'; /* Metro dependency 1357 */
|
|
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 IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as EmojiConstantsModule from '../../emojis/EmojiConstants.tsx'; /* Metro dependency 1881 */
|
|
import * as SharedModule from '../../../design/shared.tsx'; /* Metro dependency 4002 */
|
|
import * as PressablesModule from '../../../design/void/Pressables/native/Pressables.tsx'; /* Metro dependency 5278 */
|
|
import * as ReactionIconModule from '../../../design/components/Icon/native/redesign/generated/ReactionIcon.tsx'; /* Metro dependency 7950 */
|
|
|
|
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});
|
|
(ReactNativeModule).Platform;
|
|
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);
|
|
(FileImportTrackerModule).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 object = {};
|
|
object.emojiImage = {width: value, height: value};
|
|
const object3 = {lineHeight: value2, fontSize: a1};
|
|
value = undefined;
|
|
const INTERACTIVE_TEXT_DEFAULT = (Native).colors.INTERACTIVE_TEXT_DEFAULT;
|
|
object3.color = INTERACTIVE_TEXT_DEFAULT;
|
|
object3.textAlign = 'center';
|
|
object3.width = r2;
|
|
object3.height = r2;
|
|
copyDataProperties(object3, a3 ? value : null, importDefault);
|
|
object.emojiText = object3;
|
|
return object;
|
|
}
|
|
|
|
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 useThemeContext = SharedModule.useThemeContext;
|
|
const isThemeLight2 = SharedModule.isThemeLight(Reflect.apply(useThemeContext, SharedModule, []).theme);
|
|
const unsafe_rawColors = (Native).unsafe_rawColors;
|
|
const r6 = isThemeLight2 ? unsafe_rawColors.PRIMARY_500 : unsafe_rawColors.PRIMARY_300;
|
|
const PressableOpacity = (PressablesModule).PressableOpacity;
|
|
const intl = (IndexNativeModule).intl;
|
|
const string = intl.string;
|
|
const lfIHs4 = (IndexNativeModule).t.lfIHs4;
|
|
const items2 = [styles2.emojiContainer, styles];
|
|
const ReactionIcon = (ReactionIconModule).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,
|
|
(MobileVisualRefreshExperiment)('EmojiReactionRowButton'));
|
|
const value4 = ReactModule.useMemo(function() {
|
|
return {foreground: true};
|
|
}, []);
|
|
const PressableOpacity = (PressablesModule).PressableOpacity;
|
|
const intl = (IndexNativeModule).intl;
|
|
const formatToPlainString = intl.formatToPlainString;
|
|
const property = (IndexNativeModule).t['/iYSo6'];
|
|
const object2 = {};
|
|
object2.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, object2])}
|
|
disabled={emoji == null}
|
|
hitSlop={4}
|
|
onPress={onPress}
|
|
style={items2}
|
|
>
|
|
{r4}
|
|
</PressableOpacity>
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun84175, 11000, [31, 27, 1881, 33, 4501, 697, 4002, 5278, 1244, 7950, 1357, 6739, 1423, 3800,
|
|
2]) /* metro module 11000, dependencies: [31, 27, 1881, 33, 4501, 697, 4002, 5278, 1244, 7950, 1357, 6739, 1423, 3800, 2] */;
|