Files
discord-decomp/sources/modules/user_profile/native/UserProfileAboutMeCardCommand.tsx
T
2026-07-27 16:20:00 +03:00

122 lines
6.6 KiB
TypeScript

/* Metro module 8768; source: modules/user_profile/native/UserProfileAboutMeCardCommand.tsx; dependencies: [31, 661, 33, 4501, 697, 4573, 4015, 8769, 683, 4863, 4080, 8776, 5065, 5068, 2] */
function _fun68594(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#68594, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8953:6, offset: 0x01c55540, size: 305 bytes, params: 8, frame: 23
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = importAll(31) /* metro dependency 31 */;
const env0_3 = (require(661) /* metro dependency 661: Constants */).AnalyticEvents;
const env0_4 = (require(33) /* metro dependency 33 */).jsxs;
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
const object = {};
const MENTION_FOREGROUND = (importDefault(697) /* metro dependency 697: native */).colors.MENTION_FOREGROUND;
object.color = MENTION_FOREGROUND;
const MENTION_BACKGROUND = (importDefault(697) /* metro dependency 697: native */).colors.MENTION_BACKGROUND;
object.backgroundColor = MENTION_BACKGROUND;
let PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
object.marginEnd = PX_12;
PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
object.marginBottom = PX_12;
const env0_5 = Reflect.apply(createStyles, createStylesModule, [{commandClickable: object}]);
value = value.memo(UserProfileAboutMeCardCommand);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/user_profile/native/UserProfileAboutMeCardCommand.tsx');
exports.default = value;
}
function UserProfileAboutMeCardCommand({application, command, channel}) { // fn#68595, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8953:358, offset: 0x01c55671, size: 151 bytes, params: 2, frame: 17
const styles = useStyles();
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
return (
<Text
variant="text-md/bold"
onPress={onPress_68596}
onLongPress={onLongPress_68599}
style={styles.commandClickable}
>
{'/'}
{command.displayName}
</Text>
);
}
function UserProfileAboutMeCardCommandOnPress() { // fn#68596, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8953:498, owner: UserProfileAboutMeCardCommand.onPress, offset: 0x01c55708, size: 172 bytes, params: 1, frame: 18
var environment;
let value = environment.__proto__;
value = undefined;
const bestActiveInput = (require(4015) /* metro dependency 4015: ChatInputUtils */).getBestActiveInput();
const markupReactCommandRuleModule = require(8769) /* metro dependency 8769: MarkupReactCommandRule */;
const handleTapCommandMention = markupReactCommandRuleModule.handleTapCommandMention;
const object2 = {};
object2.channelId = channel.id;
object2.currentText = (bestActiveInput == null ? value : bestActiveInput.getText()) ?? '';
const commandBinding = command;
object2.commandId = commandBinding.id;
object2.commandName = commandBinding.displayName;
object2.onOpenCustomKeyboard = onOpenCustomKeyboard;
object2.onSetCommand = onSetCommand;
Reflect.apply(handleTapCommandMention, markupReactCommandRuleModule, [object2]);
return value;
}
function UserProfileAboutMeCardCommandOnLongPress() { // fn#68599, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8953:1258, owner: UserProfileAboutMeCardCommand.onLongPress, offset: 0x01c55959, size: 56 bytes, params: 1, frame: 13
let value = environment.__proto__;
value = require(8769) /* metro dependency 8769: MarkupReactCommandRule */;
const handleLongPressCommandMention = value.handleLongPressCommandMention;
const commandBinding = command;
return Reflect.apply(handleLongPressCommandMention, value, [commandBinding.displayName, commandBinding.id]);
}
function onPressOnSetCommand() { // fn#68598, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8953:759, owner: UserProfileAboutMeCardCommand.onPress.onSetCommand, offset: 0x01c557da, size: 383 bytes, params: 1, frame: 21
var r1;
var r3;
var r5;
var applicationCommandManager;
var setCommand;
var moduleValue2;
const value2 = undefined;
const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
const track = defaultImport.track;
const POPULAR_APPLICATION_COMMAND_CLICKED = AnalyticEvents.POPULAR_APPLICATION_COMMAND_CLICKED;
let object2 = {};
const applicationBinding = application;
const value4 = null;
object2.application_id = value4 == applicationBinding ? value2 : application.id;
object2.command_id = command.id;
const channelBinding = channel;
object2.guild_id = channelBinding.getGuildId();
const appAnalyticsUtilsModule = require(4863) /* metro dependency 4863: AppAnalyticsUtils */;
copyDataProperties(object2, appAnalyticsUtilsModule.collectChannelAnalyticsMetadata(channelBinding), channelBinding);
Reflect.apply(track, defaultImport, [POPULAR_APPLICATION_COMMAND_CLICKED, object2]);
(importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */).hideActionSheet();
(importDefault(8776) /* metro dependency 8776: navigateToLastChannel */)();
if (value4 != env0_0) {
env0_0.openSystemKeyboard();
}
const value6 = value4 == env0_0;
if (value6) {
r1 = value6;
r3 = value2;
} else {
applicationCommandManager = env0_0.getApplicationCommandManager();
r1 = value4 == applicationCommandManager;
r3 = applicationCommandManager;
}
if (!r1) {
setCommand = r3.setCommand;
object2 = {};
object2.channelId = channel.id;
object2.command = command;
if (value4 != application) {
moduleValue2 = require(5065) /* metro dependency 5065: ApplicationCommandUtils */;
r5 = moduleValue2.getApplicationCommandSection(application);
} else {
r5 = value4;
}
object2.section = r5;
object2.location = (require(5068) /* metro dependency 5068: ApplicationCommandTypes */).ApplicationCommandTriggerLocations.POPULAR_COMMANDS;
Reflect.apply(setCommand, r3, [object2]);
}
return value2;
}