122 lines
7.3 KiB
TypeScript
122 lines
7.3 KiB
TypeScript
/* Metro module 11867; source: modules/application_commands/native/ApplicationCommandItem.tsx; dependencies: [31, 27, 1945, 11018, 33, 4501, 697, 4584, 566, 11752, 5278, 1244, 5475, 4573, 2] */
|
|
import GuildMemberStore from '../../../stores/GuildMemberStore.tsx'; /* Metro dependency 1945 */
|
|
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 FluxModule from '../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
|
|
import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
|
|
import * as UseFontScaleModule from '../../screen/native/useFontScale.tsx'; /* Metro dependency 4584 */
|
|
import * as PressablesModule from '../../../design/void/Pressables/native/Pressables.tsx'; /* Metro dependency 5278 */
|
|
import * as ApplicationCommandsConstantsModule from './ApplicationCommandsConstants.tsx'; /* Metro dependency 11018 */
|
|
import * as ApplicationCommandUtilsModule from './ApplicationCommandUtils.tsx'; /* Metro dependency 11752 */
|
|
|
|
function _fun90990(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#90990, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12053:6, offset: 0x0204ed84, size: 243 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_9 = (CreateStylesModule).createStyles(_fun90991);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/application_commands/native/ApplicationCommandItem.tsx');
|
|
exports.default = _default_90992;
|
|
function _fun90991(a0) { // fn#90991, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12053:216, offset: 0x0204ee77, size: 187 bytes, params: 2, frame: 16
|
|
const object = {};
|
|
const object2 = {'flexDirection': 'row', 'paddingVertical': 8, 'paddingHorizontal': 16, 'alignItems': 'center'};
|
|
const Math = global.Math;
|
|
object2.height = Math.max(a0 * AUTOCOMPLETE_ROW_HEIGHT, AUTOCOMPLETE_ROW_HEIGHT);
|
|
object.applicationCommandItem = object2;
|
|
const INTERACTIVE_BACKGROUND_HOVER = (importDefault(697) /* metro dependency 697: native */).colors.INTERACTIVE_BACKGROUND_HOVER;
|
|
object.highlightedApplicationCommandItem = {backgroundColor: INTERACTIVE_BACKGROUND_HOVER};
|
|
const object4 = {'width': 32, 'height': 32, 'borderRadius': null, 'marginRight': 16};
|
|
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
|
|
object.applicationCommandIcon = object4;
|
|
object.applicationCommandDescriptionWrapper = {'flexDirection': 'column', 'flexShrink': 1, 'alignSelf': 'flex-end'};
|
|
object.applicationCommandSectionName = {'paddingLeft': 16, 'marginLeft': 'auto'};
|
|
return object;
|
|
}
|
|
|
|
function _default_90992({command, onPress, section, guildId, showIcon, highlighted}) { // fn#90992, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12053:707, offset: 0x0204ef32, size: 688 bytes, params: 2, frame: 28
|
|
showIcon = showIcon === undefined || showIcon;
|
|
highlighted = !(highlighted === undefined) && highlighted;
|
|
const styles = useStyles((UseFontScaleModule).useFontScale());
|
|
const member = (FluxModule).useStateFromStores([GuildMemberStore], _fun90993);
|
|
const value6 = ReactModule.useMemo(_fun90994, [section, member]);
|
|
const r8 = member?.nick != null ? member.nick : section?.name;
|
|
const PressableOpacity = (PressablesModule).PressableOpacity;
|
|
const intl = (IndexNativeModule).intl;
|
|
const formatToPlainString = intl.formatToPlainString;
|
|
const eo8b3e = (IndexNativeModule).t.eo8b3e;
|
|
const object2 = {applicationName: r8};
|
|
object2.commandDescription = command.displayDescription;
|
|
object2.commandName = command.displayName;
|
|
const object3 = {};
|
|
copyDataProperties(object3, styles.applicationCommandItem, undefined);
|
|
copyDataProperties(object3, highlighted ? styles.highlightedApplicationCommandItem : {}, undefined);
|
|
const items2 = [
|
|
showIcon && value6 != null && ((Component) => <Component style={styles.applicationCommandIcon} source={value6} />)(importDefault(5475) /* metro dependency 5475: FastImage */),
|
|
|
|
];
|
|
const Text = (TextModule).Text;
|
|
items2[1] = (
|
|
<View style={styles.applicationCommandDescriptionWrapper}>
|
|
<Text
|
|
lineClamp={1}
|
|
variant="text-md/semibold"
|
|
color="mobile-text-heading-primary"
|
|
>
|
|
{'/ ' + command.displayName}
|
|
</Text>
|
|
<Text
|
|
lineClamp={1}
|
|
variant="text-xs/medium"
|
|
color="text-default"
|
|
>
|
|
{command.displayDescription}
|
|
</Text>
|
|
</View>
|
|
);
|
|
items2[2] = (
|
|
<Text
|
|
style={styles.applicationCommandSectionName}
|
|
variant="eyebrow"
|
|
color="text-muted"
|
|
>
|
|
{r8}
|
|
</Text>
|
|
);
|
|
return (
|
|
<PressableOpacity
|
|
accessibilityLabel={Reflect.apply(formatToPlainString, intl, [eo8b3e, object2])}
|
|
style={object3}
|
|
accessibilityRole="button"
|
|
onPress={onPress}
|
|
>
|
|
{items2}
|
|
</PressableOpacity>
|
|
);
|
|
function _fun90993() { // fn#90993, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12053:854, offset: 0x0204f1e2, size: 79 bytes, params: 1, frame: 13
|
|
var value3;
|
|
var guildMemberStoreBinding;
|
|
if (guildId != null) {
|
|
if (section?.botId != null) {
|
|
value3 = environment.__proto__;
|
|
guildMemberStoreBinding = GuildMemberStore;
|
|
return guildMemberStoreBinding.getMember(guildId, section.botId);
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun90994() { // fn#90994, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12053:948, offset: 0x0204f231, size: 50 bytes, params: 1, frame: 13
|
|
const value = environment.__proto__;
|
|
return (ApplicationCommandUtilsModule).getApplicationCommandsIconSource(section,
|
|
member);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun90990, 11867, [31, 27, 1945, 11018, 33, 4501, 697, 4584, 566, 11752, 5278, 1244, 5475, 4573,
|
|
2]) /* metro module 11867, dependencies: [31, 27, 1945, 11018, 33, 4501, 697, 4584, 566, 11752, 5278, 1244, 5475, 4573, 2] */;
|