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.

BreakoutRoomsButton.tsx 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import { connect } from 'react-redux';
  2. import { IReduxState } from '../../../app/types';
  3. import {
  4. BREAKOUT_ROOMS_BUTTON_ENABLED
  5. } from '../../../base/flags/constants';
  6. import { getFeatureFlag } from '../../../base/flags/functions';
  7. import { translate } from '../../../base/i18n/functions';
  8. import { IconRingGroup } from '../../../base/icons/svg';
  9. import AbstractButton,
  10. {
  11. IProps as AbstractButtonProps
  12. } from '../../../base/toolbox/components/AbstractButton';
  13. import {
  14. navigate
  15. } from '../../../mobile/navigation/components/conference/ConferenceNavigationContainerRef';
  16. import { screen } from '../../../mobile/navigation/routes';
  17. /**
  18. * Implements an {@link AbstractButton} to open the breakout room screen.
  19. */
  20. class BreakoutRoomsButton extends AbstractButton<AbstractButtonProps> {
  21. accessibilityLabel = 'toolbar.accessibilityLabel.breakoutRooms';
  22. icon = IconRingGroup;
  23. label = 'breakoutRooms.buttonLabel';
  24. /**
  25. * Handles clicking / pressing the button and opens the breakout rooms screen.
  26. *
  27. * @private
  28. * @returns {void}
  29. */
  30. _handleClick() {
  31. return navigate(screen.conference.breakoutRooms);
  32. }
  33. }
  34. /**
  35. * Maps part of the redux state to the component's props.
  36. *
  37. * @param {IReduxState} state - The Redux state.
  38. * @returns {Object}
  39. */
  40. function _mapStateToProps(state: IReduxState) {
  41. const enabled = getFeatureFlag(state, BREAKOUT_ROOMS_BUTTON_ENABLED, true);
  42. return {
  43. visible: enabled
  44. };
  45. }
  46. export default translate(connect(_mapStateToProps)(BreakoutRoomsButton));