|
@@ -12,8 +12,8 @@ import {
|
12
|
12
|
showRecordingButton,
|
13
|
13
|
toggleSideToolbarContainer
|
14
|
14
|
} from '../actions';
|
15
|
|
-import Toolbar from './Toolbar';
|
16
|
15
|
import { getToolbarClassNames } from '../functions';
|
|
16
|
+import Toolbar from './Toolbar';
|
17
|
17
|
|
18
|
18
|
declare var APP: Object;
|
19
|
19
|
declare var config: Object;
|
|
@@ -79,10 +79,9 @@ class SecondaryToolbar extends Component {
|
79
|
79
|
* @type {Object}
|
80
|
80
|
*/
|
81
|
81
|
profile: {
|
82
|
|
- onMount: () => {
|
|
82
|
+ onMount: () =>
|
83
|
83
|
APP.tokenData.isGuest
|
84
|
|
- || this.props._onSetProfileButtonUnclickable(true);
|
85
|
|
- }
|
|
84
|
+ || this.props._onSetProfileButtonUnclickable(true)
|
86
|
85
|
},
|
87
|
86
|
|
88
|
87
|
/**
|
|
@@ -91,14 +90,14 @@ class SecondaryToolbar extends Component {
|
91
|
90
|
* @type {button}
|
92
|
91
|
*/
|
93
|
92
|
raisehand: {
|
94
|
|
- onMount: () => {
|
95
|
|
- APP.UI.addListener(UIEvents.LOCAL_RAISE_HAND_CHANGED,
|
96
|
|
- this.props._onLocalRaiseHandChanged);
|
97
|
|
- },
|
98
|
|
- onUnmount: () => {
|
99
|
|
- APP.UI.removeListener(UIEvents.LOCAL_RAISE_HAND_CHANGED,
|
100
|
|
- this.props._onLocalRaiseHandChanged);
|
101
|
|
- }
|
|
93
|
+ onMount: () =>
|
|
94
|
+ APP.UI.addListener(
|
|
95
|
+ UIEvents.LOCAL_RAISE_HAND_CHANGED,
|
|
96
|
+ this.props._onLocalRaiseHandChanged),
|
|
97
|
+ onUnmount: () =>
|
|
98
|
+ APP.UI.removeListener(
|
|
99
|
+ UIEvents.LOCAL_RAISE_HAND_CHANGED,
|
|
100
|
+ this.props._onLocalRaiseHandChanged)
|
102
|
101
|
},
|
103
|
102
|
|
104
|
103
|
/**
|
|
@@ -107,11 +106,9 @@ class SecondaryToolbar extends Component {
|
107
|
106
|
* @type {Object}
|
108
|
107
|
*/
|
109
|
108
|
recording: {
|
110
|
|
- onMount: () => {
|
111
|
|
- if (config.enableRecording) {
|
112
|
|
- this.props._onShowRecordingButton();
|
113
|
|
- }
|
114
|
|
- }
|
|
109
|
+ onMount: () =>
|
|
110
|
+ config.enableRecording
|
|
111
|
+ && this.props._onShowRecordingButton()
|
115
|
112
|
}
|
116
|
113
|
};
|
117
|
114
|
|
|
@@ -131,7 +128,8 @@ class SecondaryToolbar extends Component {
|
131
|
128
|
* @returns {void}
|
132
|
129
|
*/
|
133
|
130
|
componentDidMount(): void {
|
134
|
|
- APP.UI.addListener(UIEvents.SIDE_TOOLBAR_CONTAINER_TOGGLED,
|
|
131
|
+ APP.UI.addListener(
|
|
132
|
+ UIEvents.SIDE_TOOLBAR_CONTAINER_TOGGLED,
|
135
|
133
|
this.props._onSideToolbarContainerToggled);
|
136
|
134
|
}
|
137
|
135
|
|
|
@@ -141,7 +139,8 @@ class SecondaryToolbar extends Component {
|
141
|
139
|
* @returns {void}
|
142
|
140
|
*/
|
143
|
141
|
componentWillUnmount(): void {
|
144
|
|
- APP.UI.removeListener(UIEvents.SIDE_TOOLBAR_CONTAINER_TOGGLED,
|
|
142
|
+ APP.UI.removeListener(
|
|
143
|
+ UIEvents.SIDE_TOOLBAR_CONTAINER_TOGGLED,
|
145
|
144
|
this.props._onSideToolbarContainerToggled);
|
146
|
145
|
}
|
147
|
146
|
|
|
@@ -154,8 +153,8 @@ class SecondaryToolbar extends Component {
|
154
|
153
|
const { _secondaryToolbarButtons } = this.props;
|
155
|
154
|
|
156
|
155
|
// The number of buttons to show in the toolbar isn't fixed, it depends
|
157
|
|
- // on availability of features and configuration parameters, so if we
|
158
|
|
- // don't have anything to render we exit here.
|
|
156
|
+ // on the availability of features and configuration parameters. So
|
|
157
|
+ // there may be nothing to render.
|
159
|
158
|
if (_secondaryToolbarButtons.size === 0) {
|
160
|
159
|
return null;
|
161
|
160
|
}
|
|
@@ -167,7 +166,8 @@ class SecondaryToolbar extends Component {
|
167
|
166
|
<Toolbar
|
168
|
167
|
buttonHandlers = { buttonHandlers }
|
169
|
168
|
className = { secondaryToolbarClassName }
|
170
|
|
- toolbarButtons = { _secondaryToolbarButtons }>
|
|
169
|
+ toolbarButtons = { _secondaryToolbarButtons }
|
|
170
|
+ tooltipPosition = { 'right' }>
|
171
|
171
|
<FeedbackButton />
|
172
|
172
|
</Toolbar>
|
173
|
173
|
);
|
|
@@ -179,10 +179,10 @@ class SecondaryToolbar extends Component {
|
179
|
179
|
*
|
180
|
180
|
* @param {Function} dispatch - Redux action dispatcher.
|
181
|
181
|
* @returns {{
|
182
|
|
- * _onLocalRaiseHandChanged: Function,
|
183
|
|
- * _onSetProfileButtonUnclickable: Function,
|
184
|
|
- * _onShowRecordingButton: Function,
|
185
|
|
- * _onSideToolbarContainerToggled
|
|
182
|
+ * _onLocalRaiseHandChanged: Function,
|
|
183
|
+ * _onSetProfileButtonUnclickable: Function,
|
|
184
|
+ * _onShowRecordingButton: Function,
|
|
185
|
+ * _onSideToolbarContainerToggled
|
186
|
186
|
* }}
|
187
|
187
|
* @private
|
188
|
188
|
*/
|
|
@@ -237,8 +237,8 @@ function _mapDispatchToProps(dispatch: Function): Object {
|
237
|
237
|
*
|
238
|
238
|
* @param {Object} state - Snapshot of Redux store.
|
239
|
239
|
* @returns {{
|
240
|
|
- * _secondaryToolbarButtons: Map,
|
241
|
|
- * _visible: boolean
|
|
240
|
+ * _secondaryToolbarButtons: Map,
|
|
241
|
+ * _visible: boolean
|
242
|
242
|
* }}
|
243
|
243
|
* @private
|
244
|
244
|
*/
|
|
@@ -252,7 +252,7 @@ function _mapStateToProps(state: Object): Object {
|
252
|
252
|
/**
|
253
|
253
|
* Default toolbar buttons for secondary toolbar.
|
254
|
254
|
*
|
255
|
|
- * @protected
|
|
255
|
+ * @private
|
256
|
256
|
* @type {Map}
|
257
|
257
|
*/
|
258
|
258
|
_secondaryToolbarButtons: secondaryToolbarButtons,
|
|
@@ -260,7 +260,7 @@ function _mapStateToProps(state: Object): Object {
|
260
|
260
|
/**
|
261
|
261
|
* Shows whether toolbar is visible.
|
262
|
262
|
*
|
263
|
|
- * @protected
|
|
263
|
+ * @private
|
264
|
264
|
* @type {boolean}
|
265
|
265
|
*/
|
266
|
266
|
_visible: visible
|