|
@@ -4,6 +4,7 @@ import { connect } from 'react-redux';
|
4
|
4
|
import { IReduxState } from '../../../app/types';
|
5
|
5
|
import { translate } from '../../../base/i18n/functions';
|
6
|
6
|
import { IconUsers } from '../../../base/icons/svg';
|
|
7
|
+import { getParticipantCount } from '../../../base/participants/functions';
|
7
|
8
|
import AbstractButton, { IProps as AbstractButtonProps } from '../../../base/toolbox/components/AbstractButton';
|
8
|
9
|
import {
|
9
|
10
|
close as closeParticipantsPane,
|
|
@@ -29,13 +30,17 @@ interface IProps extends AbstractButtonProps {
|
29
|
30
|
* Whether participants feature is enabled or not.
|
30
|
31
|
*/
|
31
|
32
|
_isParticipantsPaneEnabled: boolean;
|
|
33
|
+
|
|
34
|
+ /**
|
|
35
|
+ * Participants count.
|
|
36
|
+ */
|
|
37
|
+ _participantsCount: number;
|
32
|
38
|
}
|
33
|
39
|
|
34
|
40
|
/**
|
35
|
41
|
* Implementation of a button for accessing participants pane.
|
36
|
42
|
*/
|
37
|
43
|
class ParticipantsPaneButton extends AbstractButton<IProps> {
|
38
|
|
- accessibilityLabel = 'toolbar.accessibilityLabel.participants';
|
39
|
44
|
toggledAccessibilityLabel = 'toolbar.accessibilityLabel.closeParticipantsPane';
|
40
|
45
|
icon = IconUsers;
|
41
|
46
|
label = 'toolbar.participants';
|
|
@@ -70,6 +75,26 @@ class ParticipantsPaneButton extends AbstractButton<IProps> {
|
70
|
75
|
}
|
71
|
76
|
}
|
72
|
77
|
|
|
78
|
+
|
|
79
|
+ /**
|
|
80
|
+ * Override the _getAccessibilityLabel method to incorporate the dynamic participant count.
|
|
81
|
+ *
|
|
82
|
+ * @override
|
|
83
|
+ * @returns {string}
|
|
84
|
+ */
|
|
85
|
+ _getAccessibilityLabel() {
|
|
86
|
+ const { t, _participantsCount, _isOpen } = this.props;
|
|
87
|
+
|
|
88
|
+ if (_isOpen) {
|
|
89
|
+ return t('toolbar.accessibilityLabel.closeParticipantsPane');
|
|
90
|
+ }
|
|
91
|
+
|
|
92
|
+ return t('toolbar.accessibilityLabel.participants', {
|
|
93
|
+ participantsCount: _participantsCount
|
|
94
|
+ });
|
|
95
|
+
|
|
96
|
+ }
|
|
97
|
+
|
73
|
98
|
/**
|
74
|
99
|
* Overrides AbstractButton's {@link Component#render()}.
|
75
|
100
|
*
|
|
@@ -105,7 +130,8 @@ function mapStateToProps(state: IReduxState) {
|
105
|
130
|
|
106
|
131
|
return {
|
107
|
132
|
_isOpen: isOpen,
|
108
|
|
- _isParticipantsPaneEnabled: isParticipantsPaneEnabled(state)
|
|
133
|
+ _isParticipantsPaneEnabled: isParticipantsPaneEnabled(state),
|
|
134
|
+ _participantsCount: getParticipantCount(state)
|
109
|
135
|
};
|
110
|
136
|
}
|
111
|
137
|
|