62 lines
3.5 KiB
TypeScript
62 lines
3.5 KiB
TypeScript
/* Metro module 12763; source: design/components/Menu/native/MenuItem.tsx; dependencies: [31, 33, 4501, 12761, 4580, 6746, 6749, 2] */
|
|
import FormRow from '../../../void/Form/native/FormRow.tsx'; /* Metro dependency 6746 */
|
|
import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
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 CreateStylesModule from '../../Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
|
|
import * as MenuModule from './Menu.tsx'; /* Metro dependency 12761 */
|
|
|
|
function _fun97540(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#97540, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12953:6, offset: 0x02188556, size: 215 bytes, params: 8, frame: 20
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactModule;
|
|
const env0_5 = (CreateStylesModule).createStyles({formIcon: {'width': 20,
|
|
'height': 20}, formLabel: {'fontSize': 14, 'fontWeight': '500'}});
|
|
value = value.forwardRef(_fun97541);
|
|
(FileImportTrackerModule).fileFinishedImporting('design/components/Menu/native/MenuItem.tsx');
|
|
exports.MenuItem = value;
|
|
function _fun97541({label, IconComponent, iconSource, showIconFirst, style, disabled, action}, a1) { // fn#97541, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12953:233, offset: 0x0218862d, size: 387 bytes, params: 3, frame: 25
|
|
showIconFirst = !(showIconFirst === undefined) && showIconFirst;
|
|
disabled = !(disabled === undefined) && disabled;
|
|
var value;
|
|
const styles = useStyles();
|
|
const binding = env0_3;
|
|
const useContext = binding.useContext;
|
|
const MenuContext = (MenuModule).MenuContext;
|
|
const env0_1 = Reflect.apply(useContext, binding, [MenuContext]).menuClose;
|
|
const r7 = (
|
|
IconComponent != null
|
|
? (
|
|
<IconComponent size="sm" />
|
|
)
|
|
: (
|
|
iconSource != null
|
|
? ((Component) => <Component source={iconSource} style={styles.formIcon} />)(importDefault(4580) /* metro dependency 4580: Icon */)
|
|
: null
|
|
)
|
|
);
|
|
const defaultImport2Props = {ref: a1, style: style, accessibilityRole: 'menuitem', disabled: disabled,
|
|
leading: iconSource != null && showIconFirst ? r7 : null};
|
|
let r5 = iconSource == null || showIconFirst ? null : r7;
|
|
defaultImport2Props.trailing = r5;
|
|
if (typeof label !== 'string') {
|
|
r5 = label;
|
|
} else {
|
|
value = importDefault(6749) /* metro dependency 6749: FormLabel */;
|
|
value = ((Component) => <Component text={label} style={styles.formLabel} />)(value);
|
|
r5 = value;
|
|
}
|
|
defaultImport2Props.label = r5;
|
|
defaultImport2Props.onPress = function() {
|
|
action();
|
|
menuClose();
|
|
};
|
|
return <FormRow {...defaultImport2Props} />;
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun97540, 12763, [31, 33, 4501, 12761, 4580, 6746, 6749,
|
|
2]) /* metro module 12763, dependencies: [31, 33, 4501, 12761, 4580, 6746, 6749, 2] */;
|