Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4821.js (118.4 MB)
112 lines
4.7 KiB
TypeScript
112 lines
4.7 KiB
TypeScript
// Module ID: 16982
|
|
// Function ID: 16983
|
|
// Name: ContextMenuCommandItem
|
|
// Dependencies: [19, 17, 21, 4636, 576, 5686, 12, 1114, 12360, 5668, 1894, 4581, 2]
|
|
// Exports: ContextMenuCommandAppItem, ContextMenuCommandEmptyItem, ContextMenuCommandLoadingItem, default
|
|
|
|
// Module 16982 (ContextMenuCommandItem)
|
|
import _modDef12 from "module_12" /* 12 */;
|
|
import nativeDefault from "native" /* 576 */;
|
|
import util from "util" /* 1114 */;
|
|
import FastImageDefault from "FastImage" /* 5668 */;
|
|
import TableRow from "TableRow" /* 5686 */;
|
|
import application_commands_ApplicationCommandUtils from "application_commands/ApplicationCommandUtils" /* 12360 */;
|
|
import noop from "module_19" /* 19 */;
|
|
|
|
require = fn;
|
|
const View = fn(17).View;
|
|
const jsx = fn(21).jsx;
|
|
const createStyles = fn(4636);
|
|
let obj2 = { commandIcon: null, loadingIcon: null, loadingName: null };
|
|
let size = { width: 32, height: 32, borderRadius: nativeDefault.radii.lg };
|
|
obj2.commandIcon = size;
|
|
obj2.loadingIcon = { backgroundColor: nativeDefault.colors.BACKGROUND_MOD_MUTED };
|
|
let obj3 = { backgroundColor: nativeDefault.colors.BACKGROUND_MOD_MUTED };
|
|
obj2.loadingName = { backgroundColor: nativeDefault.colors.BACKGROUND_MOD_MUTED, height: 24, borderRadius: nativeDefault.radii.md };
|
|
let closure_6 = createStyles.createStyles(obj2);
|
|
size = fn(2);
|
|
const result = size.fileFinishedImporting("modules/application_commands/native/ContextMenuCommandItem.tsx");
|
|
|
|
export default function ContextMenuCommandItem(item) {
|
|
item = item.item;
|
|
const section = item.section;
|
|
({ onPress, start, end } = item);
|
|
const items = [item, ];
|
|
let name;
|
|
if (section != null) {
|
|
name = section.name;
|
|
}
|
|
items[1] = name;
|
|
const memo = noop.useMemo(() => {
|
|
const type = item.type;
|
|
const intl = tmp2(1114).intl;
|
|
let name;
|
|
if (section != null) {
|
|
name = section.name;
|
|
}
|
|
return intl.formatToPlainString(util.t.Pk4Mz3, { applicationName: name, commandName: item.displayName });
|
|
}, items);
|
|
const tmp = closure_6();
|
|
const tmp5 = item;
|
|
const applicationCommandsIconSource = item(12360).getApplicationCommandsIconSource(section);
|
|
const obj2 = { accessibilityLabel: memo, onPress, label: item.displayName, icon: null, trailing: null, start: null, end: null };
|
|
let tmp8Result = null != applicationCommandsIconSource;
|
|
if (tmp8Result) {
|
|
const obj3 = { style: tmp.commandIcon, source: applicationCommandsIconSource };
|
|
tmp8Result = tmp8(section(5668), obj3);
|
|
}
|
|
obj2.icon = tmp8Result;
|
|
obj2.trailing = jsx(tmp5(4581).SendMessageIcon, {});
|
|
obj2.start = start;
|
|
obj2.end = end;
|
|
return jsx(item(5686).TableRow, { accessibilityLabel: memo, onPress, label: item.displayName, icon: null, trailing: null, start: null, end: null });
|
|
};
|
|
export const ContextMenuCommandLoadingItem = function ContextMenuCommandLoadingItem(arg0) {
|
|
({ start, end } = arg0);
|
|
const tmp = closure_6();
|
|
const obj = { label: null, icon: null, start: null, end: null };
|
|
const obj2 = { style: null };
|
|
const items = [tmp.loadingName, ];
|
|
const obj3 = { width: "" + _modDef12.random(60, 80) + "%" };
|
|
items[1] = obj3;
|
|
obj2.style = items;
|
|
obj.label = <View style={null} />;
|
|
const obj5 = { style: null };
|
|
const items1 = [, ];
|
|
({ commandIcon: arr2[0], loadingIcon: arr2[1] } = tmp);
|
|
obj5.style = items1;
|
|
obj.icon = <View style={null} />;
|
|
obj.start = start;
|
|
obj.end = end;
|
|
return jsx(TableRow.TableRow, { label: null, icon: null, start: null, end: null });
|
|
};
|
|
export const ContextMenuCommandEmptyItem = function ContextMenuCommandEmptyItem(arg0) {
|
|
({ start, end } = arg0);
|
|
const obj = { label: null, icon: null, start: null, end: null };
|
|
const intl = util.intl;
|
|
obj.label = intl.string(util.t.YSNlV2);
|
|
const obj2 = { style: null };
|
|
const items = [, ];
|
|
({ commandIcon: arr[0], loadingIcon: arr[1] } = closure_6());
|
|
obj2.style = items;
|
|
obj.icon = <View style={null} />;
|
|
obj.start = start;
|
|
obj.end = end;
|
|
return jsx(TableRow.TableRow, { label: null, icon: null, start: null, end: null });
|
|
};
|
|
export const ContextMenuCommandAppItem = function ContextMenuCommandAppItem(section) {
|
|
section = section.section;
|
|
({ onPress, start, end } = section);
|
|
const tmp = closure_6();
|
|
const applicationCommandsIconSource = application_commands_ApplicationCommandUtils.getApplicationCommandsIconSource(section);
|
|
const obj2 = { onPress, label: section.name, icon: null, start: null, end: null, arrow: true };
|
|
let tmp4Result = null != applicationCommandsIconSource;
|
|
if (tmp4Result) {
|
|
const obj3 = { style: tmp.commandIcon, source: applicationCommandsIconSource };
|
|
tmp4Result = tmp4(FastImageDefault, obj3);
|
|
}
|
|
obj2.icon = tmp4Result;
|
|
obj2.start = start;
|
|
obj2.end = end;
|
|
return jsx(TableRow.TableRow, { onPress, label: section.name, icon: null, start: null, end: null, arrow: true });
|
|
};
|