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.

AudioRouteButton.js 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // @flow
  2. import { openDialog } from '../../../base/dialog';
  3. import { translate } from '../../../base/i18n';
  4. import { IconAudioRoute } from '../../../base/icons';
  5. import { connect } from '../../../base/redux';
  6. import { AbstractButton, type AbstractButtonProps } from '../../../base/toolbox/components';
  7. import AudioRoutePickerDialog from './AudioRoutePickerDialog';
  8. type Props = AbstractButtonProps & {
  9. /**
  10. * The redux {@code dispatch} function used to open/show the
  11. * {@code AudioRoutePickerDialog}.
  12. */
  13. dispatch: Function
  14. };
  15. /**
  16. * A toolbar button which triggers an audio route picker when pressed.
  17. */
  18. class AudioRouteButton extends AbstractButton<Props, *> {
  19. accessibilityLabel = 'toolbar.accessibilityLabel.audioRoute';
  20. icon = IconAudioRoute;
  21. label = 'toolbar.audioRoute';
  22. /**
  23. * Handles clicking / pressing the button, and opens the appropriate dialog.
  24. *
  25. * @private
  26. * @returns {void}
  27. */
  28. _handleClick() {
  29. this.props.dispatch(openDialog(AudioRoutePickerDialog));
  30. }
  31. }
  32. export default translate(connect()(AudioRouteButton));