|
|
@ -3,22 +3,22 @@ import { Item } from 'rc-menu';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import Tooltip from '../tooltip';
|
|
|
|
import Tooltip from '../tooltip';
|
|
|
|
|
|
|
|
|
|
|
|
const MenuItem: any = (props, { inlineCollapsed }) => {
|
|
|
|
class MenuItem extends React.Component<any, any> {
|
|
|
|
return (
|
|
|
|
static contextTypes = {
|
|
|
|
<Tooltip
|
|
|
|
inlineCollapsed: PropTypes.bool,
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
static isMenuItem = 1;
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
|
|
|
const { inlineCollapsed } = this.context;
|
|
|
|
|
|
|
|
const props = this.props;
|
|
|
|
|
|
|
|
return <Tooltip
|
|
|
|
title={inlineCollapsed && props.level === 1 ? props.children : ''}
|
|
|
|
title={inlineCollapsed && props.level === 1 ? props.children : ''}
|
|
|
|
placement="right"
|
|
|
|
placement="right"
|
|
|
|
overlayClassName={`${props.rootPrefixCls}-inline-collapsed-tooltip`}
|
|
|
|
overlayClassName={`${props.rootPrefixCls}-inline-collapsed-tooltip`}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<Item {...props} />
|
|
|
|
<Item {...props} />
|
|
|
|
</Tooltip>
|
|
|
|
</Tooltip>;
|
|
|
|
);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
MenuItem.contextTypes = {
|
|
|
|
|
|
|
|
inlineCollapsed: PropTypes.bool,
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MenuItem.isMenuItem = 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export default MenuItem;
|
|
|
|
export default MenuItem;
|
|
|
|