99 lines
4.2 KiB
TypeScript
99 lines
4.2 KiB
TypeScript
// Module ID: 11830
|
|
// Function ID: 11831
|
|
// Name: ApplicationCommandItem
|
|
// Dependencies: [19, 17, 1990, 9961, 21, 4342, 712, 4761, 589, 11658, 4887, 1236, 5308, 4338, 2]
|
|
// Exports: default
|
|
|
|
// Module 11830 (ApplicationCommandItem)
|
|
import noop from "noop";
|
|
import { View } from "get ActivityIndicator";
|
|
import trackCommunicationDisabled from "trackCommunicationDisabled";
|
|
import { AUTOCOMPLETE_ROW_HEIGHT } from "AUTOCOMPLETE_ROW_HEIGHT";
|
|
import jsxProd from "jsxProd";
|
|
import createCacheKey from "createCacheKey";
|
|
|
|
let error;
|
|
let metroImportAll;
|
|
const require = arg1;
|
|
({ jsx: error, jsxs: metroImportAll } = jsxProd);
|
|
let closure_9 = createCacheKey.createStyles((arg0) => {
|
|
let obj = { applicationCommandItem: null, highlightedApplicationCommandItem: null, applicationCommandIcon: null, applicationCommandDescriptionWrapper: null, applicationCommandSectionName: null };
|
|
obj = { flexDirection: "row", paddingVertical: 8, paddingHorizontal: 16, alignItems: "center", height: Math.max(arg0 * AUTOCOMPLETE_ROW_HEIGHT, AUTOCOMPLETE_ROW_HEIGHT) };
|
|
obj[0] = obj;
|
|
obj = { backgroundColor: importDefault(712).colors.INTERACTIVE_BACKGROUND_HOVER };
|
|
obj[1] = obj;
|
|
obj[2] = { width: 32, height: 32, borderRadius: importDefault(712).radii.lg, marginRight: 16 };
|
|
obj[3] = { flexDirection: "column", flexShrink: 1, alignSelf: "flex-end" };
|
|
obj[4] = { paddingLeft: 16, marginLeft: "auto" };
|
|
return obj;
|
|
});
|
|
const result = require("trackCommunicationDisabled").fileFinishedImporting("modules/application_commands/native/ApplicationCommandItem.tsx");
|
|
|
|
export default function ApplicationCommandItem(highlighted) {
|
|
let command;
|
|
let importDefault;
|
|
let section;
|
|
let showIcon;
|
|
({ command, section } = highlighted);
|
|
({ guildId: importDefault, showIcon } = highlighted);
|
|
if (showIcon === undefined) {
|
|
showIcon = true;
|
|
}
|
|
let flag = highlighted.highlighted;
|
|
if (flag === undefined) {
|
|
flag = false;
|
|
}
|
|
let stateFromStores;
|
|
let obj = section(stateFromStores[7]);
|
|
const tmp3 = callback2(obj.useFontScale());
|
|
let obj1 = section(stateFromStores[8]);
|
|
const items = [trackCommunicationDisabled];
|
|
stateFromStores = obj1.useStateFromStores(items, () => {
|
|
if (null != closure_1) {
|
|
let botId;
|
|
if (section != null) {
|
|
botId = tmp2.botId;
|
|
}
|
|
if (null != botId) {
|
|
return outer1_5.getMember(tmp, tmp2.botId);
|
|
}
|
|
}
|
|
});
|
|
const items1 = [section, stateFromStores];
|
|
const memo = React.useMemo(() => section(stateFromStores[9]).getApplicationCommandsIconSource(section, stateFromStores), items1);
|
|
let nick;
|
|
if (stateFromStores != null) {
|
|
nick = stateFromStores.nick;
|
|
}
|
|
if (null != nick) {
|
|
let name = stateFromStores.nick;
|
|
} else if (section != null) {
|
|
name = section.name;
|
|
}
|
|
obj = { accessibilityLabel: null, style: null, accessibilityRole: "button", onPress: null, children: null };
|
|
const intl = tmp(tmp2[11]).intl;
|
|
obj = { applicationName: name, commandDescription: command.displayDescription, commandName: command.displayName };
|
|
obj[0] = intl.formatToPlainString(section(stateFromStores[11]).t.eo8b3e, obj);
|
|
obj1 = {};
|
|
const merged = Object.assign(tmp3.applicationCommandItem);
|
|
const merged1 = Object.assign(flag ? tmp3.highlightedApplicationCommandItem : {});
|
|
obj[1] = obj1;
|
|
obj[3] = highlighted.onPress;
|
|
if (showIcon) {
|
|
showIcon = null != memo;
|
|
}
|
|
if (showIcon) {
|
|
const obj2 = { style: null, source: null };
|
|
obj2[0] = tmp3.applicationCommandIcon;
|
|
obj2[1] = memo;
|
|
showIcon = callback(importDefault(tmp2[12]), obj2);
|
|
}
|
|
const items2 = [showIcon, , ];
|
|
const obj3 = { style: tmp3.applicationCommandDescriptionWrapper, children: null };
|
|
const items3 = [callback(section(stateFromStores[13]).Text, { lineClamp: 1, variant: "text-md/semibold", color: "mobile-text-heading-primary", children: `/ ${command.displayName}` }), callback(section(stateFromStores[13]).Text, { lineClamp: 1, variant: "text-xs/medium", color: "text-default", children: command.displayDescription })];
|
|
obj3[1] = items3;
|
|
items2[1] = closure_8(View, obj3);
|
|
items2[2] = callback(section(stateFromStores[13]).Text, { style: tmp3.applicationCommandSectionName, variant: "eyebrow", color: "text-muted", children: name });
|
|
obj[4] = items2;
|
|
return closure_8(section(stateFromStores[10]).PressableOpacity, obj);
|
|
};
|