index.tsx 688 Bytes
Newer Older
何乐's avatar
何乐 committed
1
import { DropDownProps } from 'antd/es/dropdown';
2 3
import { Dropdown } from 'antd';
import React from 'react';
4 5 6
import classNames from 'classnames';
import styles from './index.less';

7 8
declare type OverlayFunc = () => React.ReactNode;

何乐's avatar
何乐 committed
9
export interface HeaderDropdownProps extends DropDownProps {
10
  overlayClassName?: string;
11 12
  overlay: React.ReactNode | OverlayFunc;
  placement?: 'bottomLeft' | 'bottomRight' | 'topLeft' | 'topCenter' | 'topRight' | 'bottomCenter';
13 14
}

何乐's avatar
何乐 committed
15 16 17
const HeaderDropdown: React.FC<HeaderDropdownProps> = ({ overlayClassName: cls, ...restProps }) => (
  <Dropdown overlayClassName={classNames(styles.container, cls)} {...restProps} />
);
18

何乐's avatar
何乐 committed
19
export default HeaderDropdown;