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.

ConferenceInfo.js 3.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /* @flow */
  2. import React from 'react';
  3. import { getConferenceName } from '../../../base/conference/functions';
  4. import { JitsiRecordingConstants } from '../../../base/lib-jitsi-meet';
  5. import { getParticipantCount } from '../../../base/participants/functions';
  6. import { connect } from '../../../base/redux';
  7. import { E2EELabel } from '../../../e2ee';
  8. import { LocalRecordingLabel } from '../../../local-recording';
  9. import { RecordingLabel } from '../../../recording';
  10. import { isToolboxVisible } from '../../../toolbox/functions.web';
  11. import { TranscribingLabel } from '../../../transcribing';
  12. import { VideoQualityLabel } from '../../../video-quality';
  13. import ConferenceTimer from '../ConferenceTimer';
  14. import ParticipantsCount from './ParticipantsCount';
  15. import { InsecureRoomNameLabel } from '.';
  16. /**
  17. * The type of the React {@code Component} props of {@link Subject}.
  18. */
  19. type Props = {
  20. /**
  21. * Whether the info should span across the full width.
  22. */
  23. _fullWidth: boolean,
  24. /**
  25. * Whether the conference name and timer should be displayed or not.
  26. */
  27. _hideConferenceNameAndTimer: boolean,
  28. /**
  29. * Whether the conference timer should be shown or not.
  30. */
  31. _hideConferenceTimer: boolean,
  32. /**
  33. * Whether the participant count should be shown or not.
  34. */
  35. _showParticipantCount: boolean,
  36. /**
  37. * The subject or the of the conference.
  38. * Falls back to conference name.
  39. */
  40. _subject: string,
  41. /**
  42. * Indicates whether the component should be visible or not.
  43. */
  44. _visible: boolean
  45. };
  46. /**
  47. * The upper band of the meeing containing the conference name, timer and labels.
  48. *
  49. * @param {Object} props - The props of the component.
  50. * @returns {React$None}
  51. */
  52. function ConferenceInfo(props: Props) {
  53. const {
  54. _hideConferenceNameAndTimer,
  55. _hideConferenceTimer,
  56. _showParticipantCount,
  57. _subject,
  58. _fullWidth,
  59. _visible
  60. } = props;
  61. return (
  62. <div className = { `subject ${_visible ? 'visible' : ''}` }>
  63. <div className = { `subject-info-container${_fullWidth ? ' subject-info-container--full-width' : ''}` }>
  64. {
  65. !_hideConferenceNameAndTimer
  66. && <div className = 'subject-info'>
  67. { _subject && <span className = 'subject-text'>{ _subject }</span>}
  68. { !_hideConferenceTimer && <ConferenceTimer /> }
  69. </div>
  70. }
  71. { _showParticipantCount && <ParticipantsCount /> }
  72. <E2EELabel />
  73. <RecordingLabel mode = { JitsiRecordingConstants.mode.FILE } />
  74. <RecordingLabel mode = { JitsiRecordingConstants.mode.STREAM } />
  75. <LocalRecordingLabel />
  76. <TranscribingLabel />
  77. <VideoQualityLabel />
  78. <InsecureRoomNameLabel />
  79. </div>
  80. </div>
  81. );
  82. }
  83. /**
  84. * Maps (parts of) the Redux state to the associated
  85. * {@code Subject}'s props.
  86. *
  87. * @param {Object} state - The Redux state.
  88. * @private
  89. * @returns {{
  90. * _hideConferenceTimer: boolean,
  91. * _showParticipantCount: boolean,
  92. * _subject: string,
  93. * _visible: boolean
  94. * }}
  95. */
  96. function _mapStateToProps(state) {
  97. const participantCount = getParticipantCount(state);
  98. const { hideConferenceTimer, hideConferenceSubject, hideParticipantsStats } = state['features/base/config'];
  99. const { clientWidth } = state['features/base/responsive-ui'];
  100. return {
  101. _hideConferenceNameAndTimer: clientWidth < 300,
  102. _hideConferenceTimer: Boolean(hideConferenceTimer),
  103. _fullWidth: state['features/video-layout'].tileViewEnabled,
  104. _showParticipantCount: participantCount > 2 && !hideParticipantsStats,
  105. _subject: hideConferenceSubject ? '' : getConferenceName(state),
  106. _visible: isToolboxVisible(state)
  107. };
  108. }
  109. export default connect(_mapStateToProps)(ConferenceInfo);