您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

ParticipantsPaneButton.js 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. // @flow
  2. import { translate } from '../../base/i18n';
  3. import { IconParticipants } from '../../base/icons';
  4. import { connect } from '../../base/redux';
  5. import { AbstractButton, type AbstractButtonProps } from '../../base/toolbox/components';
  6. /**
  7. * The type of the React {@code Component} props of {@link ParticipantsPaneButton}.
  8. */
  9. type Props = AbstractButtonProps & {
  10. /**
  11. * Whether or not the participants pane is open.
  12. */
  13. _isOpen: boolean,
  14. };
  15. /**
  16. * Implementation of a button for accessing participants pane.
  17. */
  18. class ParticipantsPaneButton extends AbstractButton<Props, *> {
  19. accessibilityLabel = 'toolbar.accessibilityLabel.participants';
  20. icon = IconParticipants;
  21. label = 'toolbar.participants';
  22. tooltip = 'toolbar.participants';
  23. /**
  24. * Handles clicking / pressing the button, and opens the appropriate dialog.
  25. *
  26. * @protected
  27. * @returns {void}
  28. */
  29. _handleClick() {
  30. const { handleClick } = this.props;
  31. if (handleClick) {
  32. handleClick();
  33. return;
  34. }
  35. }
  36. /**
  37. * Indicates whether this button is in toggled state or not.
  38. *
  39. * @override
  40. * @protected
  41. * @returns {boolean}
  42. */
  43. _isToggled() {
  44. return this.props._isOpen;
  45. }
  46. }
  47. /**
  48. * Maps part of the Redux state to the props of this component.
  49. *
  50. * @param {Object} state - The Redux state.
  51. * @returns {Props}
  52. */
  53. function mapStateToProps(state) {
  54. const { isOpen } = state['features/participants-pane'];
  55. return {
  56. _isOpen: isOpen
  57. };
  58. }
  59. export default translate(connect(mapStateToProps)(ParticipantsPaneButton));