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

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