2018-05-15 11:18:42 +00:00
|
|
|
// @flow
|
|
|
|
|
|
|
|
import { openDialog } from '../../../base/dialog';
|
|
|
|
import { translate } from '../../../base/i18n';
|
2019-08-30 16:39:06 +00:00
|
|
|
import { IconMenuThumb } from '../../../base/icons';
|
2019-03-21 16:38:29 +00:00
|
|
|
import { connect } from '../../../base/redux';
|
2018-05-15 11:18:42 +00:00
|
|
|
import { AbstractButton } from '../../../base/toolbox';
|
|
|
|
import type { AbstractButtonProps } from '../../../base/toolbox';
|
|
|
|
|
|
|
|
import OverflowMenu from './OverflowMenu';
|
|
|
|
|
2018-05-16 21:49:03 +00:00
|
|
|
/**
|
|
|
|
* The type of the React {@code Component} props of {@link OverflowMenuButton}.
|
|
|
|
*/
|
2018-05-15 11:18:42 +00:00
|
|
|
type Props = AbstractButtonProps & {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The redux {@code dispatch} function.
|
|
|
|
*/
|
|
|
|
dispatch: Function
|
2018-05-16 21:49:03 +00:00
|
|
|
};
|
2018-05-15 11:18:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* An implementation of a button for showing the {@code OverflowMenu}.
|
|
|
|
*/
|
|
|
|
class OverflowMenuButton extends AbstractButton<Props, *> {
|
2018-06-07 20:32:18 +00:00
|
|
|
accessibilityLabel = 'toolbar.accessibilityLabel.moreActions';
|
2019-08-30 16:39:06 +00:00
|
|
|
icon = IconMenuThumb;
|
2018-05-15 11:18:42 +00:00
|
|
|
label = 'toolbar.moreActions';
|
|
|
|
|
|
|
|
/**
|
2018-05-16 21:49:03 +00:00
|
|
|
* Handles clicking / pressing this {@code OverflowMenuButton}.
|
2018-05-15 11:18:42 +00:00
|
|
|
*
|
2018-05-16 21:49:03 +00:00
|
|
|
* @protected
|
2018-05-15 11:18:42 +00:00
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_handleClick() {
|
|
|
|
this.props.dispatch(openDialog(OverflowMenu));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default translate(connect()(OverflowMenuButton));
|