|
|
@@ -3,6 +3,7 @@
|
|
3
|
3
|
import React, { Component } from 'react';
|
|
4
|
4
|
|
|
5
|
5
|
import { getConferenceName } from '../../../base/conference/functions';
|
|
|
6
|
+import { getParticipantCount } from '../../../base/participants/functions';
|
|
6
|
7
|
import { connect } from '../../../base/redux';
|
|
7
|
8
|
import { isToolboxVisible } from '../../../toolbox';
|
|
8
|
9
|
|
|
|
@@ -13,6 +14,11 @@ import ParticipantsCount from './ParticipantsCount';
|
|
13
|
14
|
*/
|
|
14
|
15
|
type Props = {
|
|
15
|
16
|
|
|
|
17
|
+ /**
|
|
|
18
|
+ * Whether then participant count should be shown or not.
|
|
|
19
|
+ */
|
|
|
20
|
+ _showParticipantCount: boolean,
|
|
|
21
|
+
|
|
16
|
22
|
/**
|
|
17
|
23
|
* The subject or the of the conference.
|
|
18
|
24
|
* Falls back to conference name.
|
|
|
@@ -39,12 +45,12 @@ class Subject extends Component<Props> {
|
|
39
|
45
|
* @returns {ReactElement}
|
|
40
|
46
|
*/
|
|
41
|
47
|
render() {
|
|
42
|
|
- const { _subject, _visible } = this.props;
|
|
|
48
|
+ const { _showParticipantCount, _subject, _visible } = this.props;
|
|
43
|
49
|
|
|
44
|
50
|
return (
|
|
45
|
51
|
<div className = { `subject ${_visible ? 'visible' : ''}` }>
|
|
46
|
52
|
<span className = 'subject-text'>{ _subject }</span>
|
|
47
|
|
- <ParticipantsCount />
|
|
|
53
|
+ { _showParticipantCount && <ParticipantsCount /> }
|
|
48
|
54
|
</div>
|
|
49
|
55
|
);
|
|
50
|
56
|
}
|
|
|
@@ -62,8 +68,10 @@ class Subject extends Component<Props> {
|
|
62
|
68
|
* }}
|
|
63
|
69
|
*/
|
|
64
|
70
|
function _mapStateToProps(state) {
|
|
|
71
|
+ const participantCount = getParticipantCount(state);
|
|
65
|
72
|
|
|
66
|
73
|
return {
|
|
|
74
|
+ _showParticipantCount: participantCount > 2,
|
|
67
|
75
|
_subject: getConferenceName(state),
|
|
68
|
76
|
_visible: isToolboxVisible(state)
|
|
69
|
77
|
};
|