|
|
|
@ -30,7 +30,7 @@ export interface SubMenuProps {
|
|
|
|
|
function SubMenu(props: SubMenuProps) {
|
|
|
|
|
const { popupClassName, icon, title, theme: customTheme } = props;
|
|
|
|
|
const context = React.useContext(MenuContext);
|
|
|
|
|
const { prefixCls, inlineCollapsed, theme: contextTheme } = context;
|
|
|
|
|
const { prefixCls, inlineCollapsed, theme: contextTheme, mode } = context;
|
|
|
|
|
|
|
|
|
|
const parentPath = useFullPath();
|
|
|
|
|
|
|
|
|
@ -68,10 +68,12 @@ function SubMenu(props: SubMenuProps) {
|
|
|
|
|
[context],
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
const popupOffset = mode === 'horizontal' ? [0, 8] : [10, 0];
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<MenuContext.Provider value={contextValue}>
|
|
|
|
|
<RcSubMenu
|
|
|
|
|
popupOffset={[10, 0]}
|
|
|
|
|
popupOffset={popupOffset}
|
|
|
|
|
{...omit(props, ['icon'])}
|
|
|
|
|
title={titleNode}
|
|
|
|
|
popupClassName={classNames(
|
|
|
|
|