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 942B

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