132 lines
6.9 KiB
TypeScript
132 lines
6.9 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] */
|
|
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
|
|
var object3;
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importAll(31) /* metro dependency 31 */;
|
|
const env0_4 = (require(27) /* metro dependency 27 */).View;
|
|
const env0_5 = (require(33) /* metro dependency 33 */).jsx;
|
|
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = createStylesModule.createStyles;
|
|
object3 = {};
|
|
const object5 = {'width': 32, 'height': 32};
|
|
object5.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
|
|
object3.commandIcon = object5;
|
|
let BACKGROUND_MOD_MUTED = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_MOD_MUTED;
|
|
object3.loadingIcon = {backgroundColor: BACKGROUND_MOD_MUTED};
|
|
const object6 = {};
|
|
BACKGROUND_MOD_MUTED = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_MOD_MUTED;
|
|
object6.backgroundColor = BACKGROUND_MOD_MUTED;
|
|
object6.height = 24;
|
|
object6.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.md;
|
|
object3.loadingName = object6;
|
|
const env0_6 = Reflect.apply(createStyles, createStylesModule, [object3]);
|
|
(require(2) /* metro dependency 2 */).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 = env0_3.useMemo(_fun116510, [item, section?.name]);
|
|
const applicationCommandsIconSource = (require(11752) /* metro dependency 11752: ApplicationCommandUtils */).getApplicationCommandsIconSource(section);
|
|
const TableRow = (require(6238) /* metro dependency 6238: TableRowNative */).TableRow;
|
|
const displayName = item.displayName;
|
|
const r7 = applicationCommandsIconSource != null && ((Component) => <Component style={styles.commandIcon} source={applicationCommandsIconSource} />)(importDefault(5475) /* metro dependency 5475: FastImage */);
|
|
const SendMessageIcon = (require(4058) /* metro dependency 4058: SendMessageIcon */).SendMessageIcon;
|
|
return (
|
|
<TableRow
|
|
accessibilityLabel={value3}
|
|
onPress={onPress}
|
|
label={displayName}
|
|
icon={r7}
|
|
trailing={<SendMessageIcon />}
|
|
start={start}
|
|
end={end}
|
|
/>
|
|
);
|
|
}
|
|
|
|
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 = (require(6238) /* metro dependency 6238: TableRowNative */).TableRow;
|
|
const items2 = [styles.loadingName];
|
|
let value = importDefault(22) /* metro dependency 22 */;
|
|
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 = (require(6238) /* metro dependency 6238: TableRowNative */).TableRow;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const string = intl.string;
|
|
const YSNlV2 = (require(1244) /* metro dependency 1244: indexNative */).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 = (require(11752) /* metro dependency 11752: ApplicationCommandUtils */).getApplicationCommandsIconSource(section);
|
|
const TableRow = (require(6238) /* metro dependency 6238: TableRowNative */).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
|
|
/>
|
|
);
|
|
}
|
|
|
|
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 = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
const type = item.type;
|
|
const value3 = undefined;
|
|
const ApplicationCommandType = (require(1909) /* metro dependency 1909: Server */).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;
|
|
}
|
|
|