mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-12 11:55:23 +08:00
23 lines
556 B
TypeScript
23 lines
556 B
TypeScript
|
import React from 'react';
|
||
|
import PropTypes from 'prop-types';
|
||
|
import { SubMenu as RcSubMenu } from 'rc-menu';
|
||
|
import classNames from 'classnames';
|
||
|
|
||
|
class SubMenu extends React.Component<any, any> {
|
||
|
static contextTypes = {
|
||
|
antdMenuTheme: PropTypes.string,
|
||
|
};
|
||
|
render() {
|
||
|
const { rootPrefixCls, className } = this.props;
|
||
|
const theme = this.context.antdMenuTheme;
|
||
|
return (
|
||
|
<RcSubMenu
|
||
|
{...this.props}
|
||
|
popupClassName={classNames(`${rootPrefixCls}-${theme}`, className)}
|
||
|
/>
|
||
|
);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
export default SubMenu;
|