feat(jaas) add config for displaying participants stats and conference subject

This commit is contained in:
Tudor-Ovidiu Avram 2021-01-07 15:31:53 +02:00
parent 3881da5db9
commit d49c5a6d8c
4 changed files with 25 additions and 6 deletions

View File

@ -623,9 +623,15 @@ var config = {
// otherwise the app doesn't render it.
// moderatedRoomServiceUrl: 'https://moderated.jitsi-meet.example.com',
// Hides the conference subject
// hideConferenceSubject: true
// Hides the conference timer.
// hideConferenceTimer: true,
// Hides the participants stats
// hideParticipantsStats: true
// Sets the conference subject
// subject: 'Conference Subject',

View File

@ -117,6 +117,8 @@ export default [
'forceTurnRelay',
'gatherStats',
'googleApiApplicationClientID',
'hideConferenceSubject',
'hideParticipantsStats',
'hideConferenceTimer',
'hiddenDomain',
'hideLobbyButton',

View File

@ -95,11 +95,14 @@ class NavigationBar extends Component<Props> {
* @returns {Props}
*/
function _mapStateToProps(state) {
const { hideConferenceTimer, hideConferenceSubject } = state['features/base/config'];
return {
_conferenceTimerEnabled:
getFeatureFlag(state, CONFERENCE_TIMER_ENABLED, true) && !state['features/base/config'].hideConferenceTimer,
getFeatureFlag(state, CONFERENCE_TIMER_ENABLED, true) && !hideConferenceTimer,
_meetingName: getConferenceName(state),
_meetingNameEnabled: getFeatureFlag(state, MEETING_NAME_ENABLED, true),
_meetingNameEnabled:
getFeatureFlag(state, MEETING_NAME_ENABLED, true) && !hideConferenceSubject,
_visible: isToolboxVisible(state)
};
}

View File

@ -25,6 +25,11 @@ type Props = {
*/
_showParticipantCount: boolean,
/**
* Whether the conference subject should be shown or not.
*/
_showSubject: boolean,
/**
* The subject or the of the conference.
* Falls back to conference name.
@ -51,11 +56,11 @@ class Subject extends Component<Props> {
* @returns {ReactElement}
*/
render() {
const { _hideConferenceTimer, _showParticipantCount, _subject, _visible } = this.props;
const { _hideConferenceTimer, _showParticipantCount, _showSubject, _subject, _visible } = this.props;
return (
<div className = { `subject ${_visible ? 'visible' : ''}` }>
<span className = 'subject-text'>{ _subject }</span>
{ _showSubject && <span className = 'subject-text'>{ _subject }</span>}
{ _showParticipantCount && <ParticipantsCount /> }
{ !_hideConferenceTimer && <ConferenceTimer /> }
</div>
@ -72,16 +77,19 @@ class Subject extends Component<Props> {
* @returns {{
* _hideConferenceTimer: boolean,
* _showParticipantCount: boolean,
* _showSubject: boolean,
* _subject: string,
* _visible: boolean
* }}
*/
function _mapStateToProps(state) {
const participantCount = getParticipantCount(state);
const { hideConferenceTimer, hideConferenceSubject, hideParticipantsStats } = state['features/base/config'];
return {
_hideConferenceTimer: Boolean(state['features/base/config'].hideConferenceTimer),
_showParticipantCount: participantCount > 2,
_hideConferenceTimer: Boolean(hideConferenceTimer),
_showParticipantCount: participantCount > 2 && !hideParticipantsStats,
_showSubject: !hideConferenceSubject,
_subject: getConferenceName(state),
_visible: isToolboxVisible(state) && participantCount > 1
};