2019-12-23 18:33:08 +08:00
|
|
|
import { createContext } from 'react';
|
2022-11-18 00:18:18 +08:00
|
|
|
import type { MenuProps } from 'rc-menu';
|
2022-05-07 14:31:54 +08:00
|
|
|
import type { DirectionType } from '../config-provider';
|
2019-07-22 21:15:48 +08:00
|
|
|
|
|
|
|
export type MenuTheme = 'light' | 'dark';
|
|
|
|
|
|
|
|
export interface MenuContextProps {
|
2021-05-07 17:23:05 +08:00
|
|
|
prefixCls: string;
|
2019-07-22 21:15:48 +08:00
|
|
|
inlineCollapsed: boolean;
|
2020-11-04 14:12:45 +08:00
|
|
|
direction?: DirectionType;
|
2022-11-18 00:18:18 +08:00
|
|
|
mode?: MenuProps['mode'];
|
2022-09-19 22:17:26 +08:00
|
|
|
theme?: MenuTheme;
|
2021-05-07 17:23:05 +08:00
|
|
|
firstLevel: boolean;
|
2022-09-30 14:26:41 +08:00
|
|
|
/** @internal Safe to remove */
|
2021-12-24 10:57:35 +08:00
|
|
|
disableMenuItemTitleTooltip?: boolean;
|
2019-07-22 21:15:48 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
const MenuContext = createContext<MenuContextProps>({
|
2021-05-07 17:23:05 +08:00
|
|
|
prefixCls: '',
|
|
|
|
firstLevel: true,
|
2019-07-22 21:15:48 +08:00
|
|
|
inlineCollapsed: false,
|
|
|
|
});
|
|
|
|
|
|
|
|
export default MenuContext;
|