index.tsx 709 B

1234567891011121314151617181920
  1. import { DropDownProps } from 'antd/es/dropdown';
  2. import { Dropdown } from 'antd';
  3. import React from 'react';
  4. import classNames from 'classnames';
  5. import styles from './index.less';
  6. declare type OverlayFunc = () => React.ReactNode;
  7. export interface HeaderDropdownProps extends Omit<DropDownProps, 'overlay'> {
  8. overlayClassName?: string;
  9. menu: React.ReactNode | OverlayFunc | any;
  10. placement?: 'bottomLeft' | 'bottomRight' | 'topLeft' | 'topCenter' | 'topRight' | 'bottomCenter';
  11. }
  12. const HeaderDropdown: React.FC<HeaderDropdownProps> = ({ overlayClassName: cls, ...restProps }) => (
  13. <Dropdown overlayClassName={classNames(styles.container, cls)} {...restProps} />
  14. );
  15. export default HeaderDropdown;