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

ParticipantsPaneButton.js 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. * External handler for click action.
  16. */
  17. handleClick: Function
  18. };
  19. /**
  20. * Implementation of a button for accessing participants pane.
  21. */
  22. class ParticipantsPaneButton extends AbstractButton<Props, *> {
  23. accessibilityLabel = 'toolbar.accessibilityLabel.participants';
  24. icon = IconParticipants;
  25. label = 'toolbar.participants';
  26. tooltip = 'toolbar.participants';
  27. /**
  28. * Handles clicking / pressing the button, and opens the appropriate dialog.
  29. *
  30. * @protected
  31. * @returns {void}
  32. */
  33. _handleClick() {
  34. this.props.handleClick();
  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));