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.

ParticipantsPaneButton.js 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // @flow
  2. import type { Dispatch } from 'redux';
  3. import { openDialog } from '../../../base/dialog';
  4. import { translate } from '../../../base/i18n';
  5. import { IconParticipants } from '../../../base/icons';
  6. import { connect } from '../../../base/redux';
  7. import { AbstractButton, type AbstractButtonProps } from '../../../base/toolbox/components';
  8. import { ParticipantsPane } from './';
  9. type Props = AbstractButtonProps & {
  10. /**
  11. * The redux {@code dispatch} function.
  12. */
  13. dispatch: Dispatch<any>
  14. };
  15. /**
  16. * Implements an {@link AbstractButton} to open the participants panel.
  17. */
  18. class ParticipantsPaneButton extends AbstractButton<Props, *> {
  19. accessibilityLabel = 'toolbar.accessibilityLabel.participants';
  20. icon = IconParticipants;
  21. label = 'toolbar.participants';
  22. /**
  23. * Handles clicking / pressing the button, and opens the participants panel.
  24. *
  25. * @private
  26. * @returns {void}
  27. */
  28. _handleClick() {
  29. this.props.dispatch(openDialog(ParticipantsPane));
  30. }
  31. }
  32. /**
  33. * Maps part of the redux state to the component's props.
  34. *
  35. * @param {Object} state - The redux store/state.
  36. * @returns {Props}
  37. */
  38. function mapStateToProps(state: Object) {
  39. return {
  40. state
  41. };
  42. }
  43. export default translate(connect(mapStateToProps)(ParticipantsPaneButton));