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.

StatusLabel.js 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import React, { Component } from 'react';
  2. import { connect } from 'react-redux';
  3. import AudioOnlyLabel from './AudioOnlyLabel';
  4. /**
  5. * Component responsible for displaying a label that indicates some state of the
  6. * current conference. The AudioOnlyLabel component will be displayed when the
  7. * conference is in audio only mode.
  8. */
  9. export class StatusLabel extends Component {
  10. /**
  11. * StatusLabel component's property types.
  12. *
  13. * @static
  14. */
  15. static propTypes = {
  16. /**
  17. * The redux store representation of the current conference.
  18. */
  19. _conference: React.PropTypes.object
  20. }
  21. /**
  22. * Implements React's {@link Component#render()}.
  23. *
  24. * @inheritdoc
  25. * @returns {ReactElement|null}
  26. */
  27. render() {
  28. if (!this.props._conference.audioOnly) {
  29. return null;
  30. }
  31. return (
  32. <div className = 'moveToCorner'>
  33. <AudioOnlyLabel />
  34. </div>
  35. );
  36. }
  37. }
  38. /**
  39. * Maps (parts of) the Redux state to the associated StatusLabel's props.
  40. *
  41. * @param {Object} state - The Redux state.
  42. * @private
  43. * @returns {{
  44. * _conference: Object,
  45. * }}
  46. */
  47. function _mapStateToProps(state) {
  48. return {
  49. _conference: state['features/base/conference']
  50. };
  51. }
  52. export default connect(_mapStateToProps)(StatusLabel);