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

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