You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

OverflowMenuButton.js 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // @flow
  2. import { openDialog } from '../../../base/dialog';
  3. import { translate } from '../../../base/i18n';
  4. import { IconMenuThumb } from '../../../base/icons';
  5. import { connect } from '../../../base/redux';
  6. import { AbstractButton } from '../../../base/toolbox';
  7. import type { AbstractButtonProps } from '../../../base/toolbox';
  8. import OverflowMenu from './OverflowMenu';
  9. /**
  10. * The type of the React {@code Component} props of {@link OverflowMenuButton}.
  11. */
  12. type Props = AbstractButtonProps & {
  13. /**
  14. * The redux {@code dispatch} function.
  15. */
  16. dispatch: Function
  17. };
  18. /**
  19. * An implementation of a button for showing the {@code OverflowMenu}.
  20. */
  21. class OverflowMenuButton extends AbstractButton<Props, *> {
  22. accessibilityLabel = 'toolbar.accessibilityLabel.moreActions';
  23. icon = IconMenuThumb;
  24. label = 'toolbar.moreActions';
  25. /**
  26. * Handles clicking / pressing this {@code OverflowMenuButton}.
  27. *
  28. * @protected
  29. * @returns {void}
  30. */
  31. _handleClick() {
  32. this.props.dispatch(openDialog(OverflowMenu));
  33. }
  34. }
  35. export default translate(connect()(OverflowMenuButton));