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 { 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. * Indicates whether this button is in toggled state or not.
  25. *
  26. * @override
  27. * @protected
  28. * @returns {boolean}
  29. */
  30. _isToggled() {
  31. return this.props._isOpen;
  32. }
  33. }
  34. /**
  35. * Maps part of the Redux state to the props of this component.
  36. *
  37. * @param {Object} state - The Redux state.
  38. * @returns {Props}
  39. */
  40. function mapStateToProps(state) {
  41. const { isOpen } = state['features/participants-pane'];
  42. return {
  43. _isOpen: isOpen
  44. };
  45. }
  46. export default translate(connect(mapStateToProps)(ParticipantsPaneButton));