141 lines
8.0 KiB
TypeScript
141 lines
8.0 KiB
TypeScript
/* Metro module 15229; source: modules/application_commands/native/ContextMenuCommandItem.tsx; dependencies: [31, 27, 33, 4501, 697, 6238, 22, 1244, 11752, 5475, 1909, 4058, 2] */
|
|
import Module00022 from '../../../by-id/module-00022.js'; /* Metro dependency 22 */
|
|
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 ServerModule from '../../../flow/Server.tsx'; /* Metro dependency 1909 */
|
|
import * as SendMessageIconModule from '../../../design/components/Icon/native/redesign/generated/SendMessageIcon.tsx'; /* Metro dependency 4058 */
|
|
import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
|
|
import * as TableRowNativeModule from '../../../design/components/TableRow/native/TableRow.native.tsx'; /* Metro dependency 6238 */
|
|
import * as ApplicationCommandUtilsModule from './ApplicationCommandUtils.tsx'; /* Metro dependency 11752 */
|
|
|
|
function _fun116508(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#116508, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15426:6, offset: 0x0248bfc8, size: 369 bytes, params: 8, frame: 22
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const createStyles = CreateStylesModule.createStyles;
|
|
object = {};
|
|
const object2 = {'width': 32, 'height': 32};
|
|
object2.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
|
|
object.commandIcon = object2;
|
|
let BACKGROUND_MOD_MUTED = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_MOD_MUTED;
|
|
object.loadingIcon = {backgroundColor: BACKGROUND_MOD_MUTED};
|
|
const object4 = {};
|
|
BACKGROUND_MOD_MUTED = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_MOD_MUTED;
|
|
object4.backgroundColor = BACKGROUND_MOD_MUTED;
|
|
object4.height = 24;
|
|
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.md;
|
|
object.loadingName = object4;
|
|
const env0_6 = Reflect.apply(createStyles, CreateStylesModule, [object]);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/application_commands/native/ContextMenuCommandItem.tsx');
|
|
exports.default = ContextMenuCommandItem;
|
|
exports.ContextMenuCommandLoadingItem = ContextMenuCommandLoadingItem;
|
|
exports.ContextMenuCommandEmptyItem = ContextMenuCommandEmptyItem;
|
|
exports.ContextMenuCommandAppItem = ContextMenuCommandAppItem;
|
|
function ContextMenuCommandItem({item, onPress, section, start, end}) { // fn#116509, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15426:503, offset: 0x0248c139, size: 290 bytes, params: 2, frame: 24
|
|
const styles = useStyles();
|
|
const value3 = ReactModule.useMemo(_fun116510, [item, section?.name]);
|
|
const applicationCommandsIconSource = (ApplicationCommandUtilsModule).getApplicationCommandsIconSource(section);
|
|
const TableRow = (TableRowNativeModule).TableRow;
|
|
const displayName = item.displayName;
|
|
const r7 = applicationCommandsIconSource != null && ((Component) => <Component style={styles.commandIcon} source={applicationCommandsIconSource} />)(importDefault(5475) /* metro dependency 5475: FastImage */);
|
|
const SendMessageIcon = (SendMessageIconModule).SendMessageIcon;
|
|
return (
|
|
<TableRow
|
|
accessibilityLabel={value3}
|
|
onPress={onPress}
|
|
label={displayName}
|
|
icon={r7}
|
|
trailing={<SendMessageIcon />}
|
|
start={start}
|
|
end={end}
|
|
/>
|
|
);
|
|
function _fun116510() { // fn#116510, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15426:602, offset: 0x0248c25b, size: 193 bytes, params: 1, frame: 17
|
|
const intl = (IndexNativeModule).intl;
|
|
const t = (IndexNativeModule).t;
|
|
const type = item.type;
|
|
const value3 = undefined;
|
|
const ApplicationCommandType = (ServerModule).ApplicationCommandType;
|
|
const MESSAGE = ApplicationCommandType.MESSAGE;
|
|
if (MESSAGE === type) {
|
|
return intl.formatToPlainString(t.Pk4Mz3, {applicationName: section == null ? value3 : section.name,
|
|
commandName: item.displayName});
|
|
}
|
|
const USER = ApplicationCommandType.USER;
|
|
if (USER === type) {
|
|
return intl.formatToPlainString(t.Pk4Mz3, {applicationName: section == null ? value3 : section.name,
|
|
commandName: item.displayName});
|
|
}
|
|
return value3;
|
|
}
|
|
|
|
}
|
|
|
|
function ContextMenuCommandLoadingItem({start, end}) { // fn#116511, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15426:1147, offset: 0x0248c31c, size: 219 bytes, params: 2, frame: 24
|
|
const styles = useStyles();
|
|
const TableRow = (TableRowNativeModule).TableRow;
|
|
const items2 = [styles.loadingName];
|
|
let value = Module00022;
|
|
value = value.random(60, 80);
|
|
items2[1] = {width: '' + value + '%'};
|
|
return (
|
|
<TableRow
|
|
label={<View style={items2} />}
|
|
icon={<View style={[styles.commandIcon, styles.loadingIcon]} />}
|
|
start={start}
|
|
end={end}
|
|
/>
|
|
);
|
|
}
|
|
|
|
function ContextMenuCommandEmptyItem({start, end}) { // fn#116512, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15426:1406, offset: 0x0248c3f7, size: 171 bytes, params: 2, frame: 22
|
|
const styles = useStyles();
|
|
const TableRow = (TableRowNativeModule).TableRow;
|
|
const intl = (IndexNativeModule).intl;
|
|
const string = intl.string;
|
|
const YSNlV2 = (IndexNativeModule).t.YSNlV2;
|
|
return (
|
|
<TableRow
|
|
label={Reflect.apply(string, intl, [YSNlV2])}
|
|
icon={<View style={[styles.commandIcon, styles.loadingIcon]} />}
|
|
start={start}
|
|
end={end}
|
|
/>
|
|
);
|
|
}
|
|
|
|
function ContextMenuCommandAppItem({section, onPress, start, end}) { // fn#116513, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15426:1634, offset: 0x0248c4a2, size: 187 bytes, params: 2, frame: 22
|
|
var r6;
|
|
var value;
|
|
const styles = useStyles();
|
|
const applicationCommandsIconSource = (ApplicationCommandUtilsModule).getApplicationCommandsIconSource(section);
|
|
const TableRow = (TableRowNativeModule).TableRow;
|
|
const name = section.name;
|
|
const value3 = applicationCommandsIconSource != null;
|
|
if (value3) {
|
|
value = importDefault(5475) /* metro dependency 5475: FastImage */;
|
|
value = ((Component) => <Component style={styles.commandIcon} source={applicationCommandsIconSource} />)(value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value3;
|
|
}
|
|
return (
|
|
<TableRow
|
|
onPress={onPress}
|
|
label={name}
|
|
icon={r6}
|
|
start={start}
|
|
end={end}
|
|
arrow
|
|
/>
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun116508, 15229, [31, 27, 33, 4501, 697, 6238, 22, 1244, 11752, 5475, 1909, 4058,
|
|
2]) /* metro module 15229, dependencies: [31, 27, 33, 4501, 697, 6238, 22, 1244, 11752, 5475, 1909, 4058, 2] */;
|