|
|
@@ -3,11 +3,13 @@
|
|
3
|
3
|
import React, { Component } from 'react';
|
|
4
|
4
|
import { View } from 'react-native';
|
|
5
|
5
|
|
|
6
|
|
-import { Container } from '../../../base/react';
|
|
7
|
6
|
import { ColorSchemeRegistry } from '../../../base/color-scheme';
|
|
|
7
|
+import { CHAT_ENABLED, getFeatureFlag } from '../../../base/flags';
|
|
|
8
|
+import { Container } from '../../../base/react';
|
|
8
|
9
|
import { connect } from '../../../base/redux';
|
|
9
|
10
|
import { StyleType } from '../../../base/styles';
|
|
10
|
11
|
import { ChatButton } from '../../../chat';
|
|
|
12
|
+import { InfoDialogButton } from '../../../invite';
|
|
11
|
13
|
|
|
12
|
14
|
import { isToolboxVisible } from '../../functions';
|
|
13
|
15
|
import { HANGUP_BUTTON_SIZE } from '../../constants';
|
|
|
@@ -41,6 +43,11 @@ const _BUTTON_SIZE_FACTOR = 0.85;
|
|
41
|
43
|
*/
|
|
42
|
44
|
type Props = {
|
|
43
|
45
|
|
|
|
46
|
+ /**
|
|
|
47
|
+ * Whether the chat feature has been enabled. The meeting info button will be displayed in its place when disabled.
|
|
|
48
|
+ */
|
|
|
49
|
+ _chatEnabled: boolean,
|
|
|
50
|
+
|
|
44
|
51
|
/**
|
|
45
|
52
|
* The color-schemed stylesheet of the feature.
|
|
46
|
53
|
*/
|
|
|
@@ -202,7 +209,7 @@ class Toolbox extends Component<Props, State> {
|
|
202
|
209
|
* @returns {React$Node}
|
|
203
|
210
|
*/
|
|
204
|
211
|
_renderToolbar() {
|
|
205
|
|
- const { _styles } = this.props;
|
|
|
212
|
+ const { _chatEnabled, _styles } = this.props;
|
|
206
|
213
|
const buttonSize = this._calculateButtonSize();
|
|
207
|
214
|
let { buttonStyles, toggledButtonStyles } = _styles;
|
|
208
|
215
|
|
|
|
@@ -239,11 +246,20 @@ class Toolbox extends Component<Props, State> {
|
|
239
|
246
|
<View
|
|
240
|
247
|
pointerEvents = 'box-none'
|
|
241
|
248
|
style = { styles.toolbar }>
|
|
242
|
|
- <ChatButton
|
|
243
|
|
- styles = { buttonStyles }
|
|
244
|
|
- toggledStyles = {
|
|
245
|
|
- this._getChatButtonToggledStyle(toggledButtonStyles)
|
|
246
|
|
- } />
|
|
|
249
|
+ {
|
|
|
250
|
+ _chatEnabled
|
|
|
251
|
+ && <ChatButton
|
|
|
252
|
+ styles = { buttonStyles }
|
|
|
253
|
+ toggledStyles = {
|
|
|
254
|
+ this._getChatButtonToggledStyle(toggledButtonStyles)
|
|
|
255
|
+ } />
|
|
|
256
|
+ }
|
|
|
257
|
+ {
|
|
|
258
|
+ !_chatEnabled
|
|
|
259
|
+ && <InfoDialogButton
|
|
|
260
|
+ styles = { buttonStyles }
|
|
|
261
|
+ toggledStyles = { toggledButtonStyles } />
|
|
|
262
|
+ }
|
|
247
|
263
|
<AudioMuteButton
|
|
248
|
264
|
styles = { buttonStyles }
|
|
249
|
265
|
toggledStyles = { toggledButtonStyles } />
|
|
|
@@ -268,12 +284,14 @@ class Toolbox extends Component<Props, State> {
|
|
268
|
284
|
* {@code Toolbox} props.
|
|
269
|
285
|
* @private
|
|
270
|
286
|
* @returns {{
|
|
|
287
|
+ * _chatEnabled: boolean,
|
|
271
|
288
|
* _styles: StyleType,
|
|
272
|
289
|
* _visible: boolean
|
|
273
|
290
|
* }}
|
|
274
|
291
|
*/
|
|
275
|
292
|
function _mapStateToProps(state: Object): Object {
|
|
276
|
293
|
return {
|
|
|
294
|
+ _chatEnabled: getFeatureFlag(state, CHAT_ENABLED, true),
|
|
277
|
295
|
_styles: ColorSchemeRegistry.get(state, 'Toolbox'),
|
|
278
|
296
|
_visible: isToolboxVisible(state)
|
|
279
|
297
|
};
|