|
|
@@ -85,6 +85,7 @@ import AudioSettingsButton from './AudioSettingsButton';
|
|
85
|
85
|
import FullscreenButton from './FullscreenButton';
|
|
86
|
86
|
import OverflowMenuButton from './OverflowMenuButton';
|
|
87
|
87
|
import ProfileButton from './ProfileButton';
|
|
|
88
|
+import RaiseHandButton from './RaiseHandButton';
|
|
88
|
89
|
import Separator from './Separator';
|
|
89
|
90
|
import ShareDesktopButton from './ShareDesktopButton';
|
|
90
|
91
|
import VideoSettingsButton from './VideoSettingsButton';
|
|
|
@@ -213,7 +214,12 @@ type Props = {
|
|
213
|
214
|
/**
|
|
214
|
215
|
* Returns the selected virtual source object.
|
|
215
|
216
|
*/
|
|
216
|
|
- _virtualSource: Object,
|
|
|
217
|
+ _virtualSource: Object,
|
|
|
218
|
+
|
|
|
219
|
+ /**
|
|
|
220
|
+ * Whether or not reactions feature is enabled.
|
|
|
221
|
+ */
|
|
|
222
|
+ _reactionsEnabled: boolean,
|
|
217
|
223
|
|
|
218
|
224
|
/**
|
|
219
|
225
|
* Invoked to active other features of the app.
|
|
|
@@ -259,6 +265,7 @@ class Toolbox extends Component<Props> {
|
|
259
|
265
|
this._onToolbarOpenVideoQuality = this._onToolbarOpenVideoQuality.bind(this);
|
|
260
|
266
|
this._onToolbarToggleChat = this._onToolbarToggleChat.bind(this);
|
|
261
|
267
|
this._onToolbarToggleFullScreen = this._onToolbarToggleFullScreen.bind(this);
|
|
|
268
|
+ this._onToolbarToggleRaiseHand = this._onToolbarToggleRaiseHand.bind(this);
|
|
262
|
269
|
this._onToolbarToggleScreenshare = this._onToolbarToggleScreenshare.bind(this);
|
|
263
|
270
|
this._onShortcutToggleTileView = this._onShortcutToggleTileView.bind(this);
|
|
264
|
271
|
this._onEscKey = this._onEscKey.bind(this);
|
|
|
@@ -271,7 +278,7 @@ class Toolbox extends Component<Props> {
|
|
271
|
278
|
* @returns {void}
|
|
272
|
279
|
*/
|
|
273
|
280
|
componentDidMount() {
|
|
274
|
|
- const { _toolbarButtons, t, dispatch } = this.props;
|
|
|
281
|
+ const { _toolbarButtons, t, dispatch, _reactionsEnabled } = this.props;
|
|
275
|
282
|
const KEYBOARD_SHORTCUTS = [
|
|
276
|
283
|
isToolbarButtonEnabled('videoquality', _toolbarButtons) && {
|
|
277
|
284
|
character: 'A',
|
|
|
@@ -320,30 +327,32 @@ class Toolbox extends Component<Props> {
|
|
320
|
327
|
}
|
|
321
|
328
|
});
|
|
322
|
329
|
|
|
323
|
|
- const REACTION_SHORTCUTS = Object.keys(REACTIONS).map(key => {
|
|
324
|
|
- const onShortcutSendReaction = () => {
|
|
325
|
|
- dispatch(addReactionToBuffer(key));
|
|
326
|
|
- sendAnalytics(createShortcutEvent(
|
|
327
|
|
- `reaction.${key}`
|
|
328
|
|
- ));
|
|
329
|
|
- };
|
|
330
|
|
-
|
|
331
|
|
- return {
|
|
332
|
|
- character: REACTIONS[key].shortcutChar,
|
|
333
|
|
- exec: onShortcutSendReaction,
|
|
334
|
|
- helpDescription: t(`toolbar.reaction${key.charAt(0).toUpperCase()}${key.slice(1)}`),
|
|
335
|
|
- altKey: true
|
|
336
|
|
- };
|
|
337
|
|
- });
|
|
338
|
|
-
|
|
339
|
|
- REACTION_SHORTCUTS.forEach(shortcut => {
|
|
340
|
|
- APP.keyboardshortcut.registerShortcut(
|
|
341
|
|
- shortcut.character,
|
|
342
|
|
- null,
|
|
343
|
|
- shortcut.exec,
|
|
344
|
|
- shortcut.helpDescription,
|
|
345
|
|
- shortcut.altKey);
|
|
346
|
|
- });
|
|
|
330
|
+ if (_reactionsEnabled) {
|
|
|
331
|
+ const REACTION_SHORTCUTS = Object.keys(REACTIONS).map(key => {
|
|
|
332
|
+ const onShortcutSendReaction = () => {
|
|
|
333
|
+ dispatch(addReactionToBuffer(key));
|
|
|
334
|
+ sendAnalytics(createShortcutEvent(
|
|
|
335
|
+ `reaction.${key}`
|
|
|
336
|
+ ));
|
|
|
337
|
+ };
|
|
|
338
|
+
|
|
|
339
|
+ return {
|
|
|
340
|
+ character: REACTIONS[key].shortcutChar,
|
|
|
341
|
+ exec: onShortcutSendReaction,
|
|
|
342
|
+ helpDescription: t(`toolbar.reaction${key.charAt(0).toUpperCase()}${key.slice(1)}`),
|
|
|
343
|
+ altKey: true
|
|
|
344
|
+ };
|
|
|
345
|
+ });
|
|
|
346
|
+
|
|
|
347
|
+ REACTION_SHORTCUTS.forEach(shortcut => {
|
|
|
348
|
+ APP.keyboardshortcut.registerShortcut(
|
|
|
349
|
+ shortcut.character,
|
|
|
350
|
+ null,
|
|
|
351
|
+ shortcut.exec,
|
|
|
352
|
+ shortcut.helpDescription,
|
|
|
353
|
+ shortcut.altKey);
|
|
|
354
|
+ });
|
|
|
355
|
+ }
|
|
347
|
356
|
}
|
|
348
|
357
|
|
|
349
|
358
|
/**
|
|
|
@@ -375,9 +384,11 @@ class Toolbox extends Component<Props> {
|
|
375
|
384
|
[ 'A', 'C', 'D', 'R', 'S' ].forEach(letter =>
|
|
376
|
385
|
APP.keyboardshortcut.unregisterShortcut(letter));
|
|
377
|
386
|
|
|
378
|
|
- Object.keys(REACTIONS).map(key => REACTIONS[key].shortcutChar)
|
|
379
|
|
- .forEach(letter =>
|
|
380
|
|
- APP.keyboardshortcut.unregisterShortcut(letter, true));
|
|
|
387
|
+ if (this.props._reactionsEnabled) {
|
|
|
388
|
+ Object.keys(REACTIONS).map(key => REACTIONS[key].shortcutChar)
|
|
|
389
|
+ .forEach(letter =>
|
|
|
390
|
+ APP.keyboardshortcut.unregisterShortcut(letter, true));
|
|
|
391
|
+ }
|
|
381
|
392
|
}
|
|
382
|
393
|
|
|
383
|
394
|
/**
|
|
|
@@ -541,7 +552,8 @@ class Toolbox extends Component<Props> {
|
|
541
|
552
|
const {
|
|
542
|
553
|
_feedbackConfigured,
|
|
543
|
554
|
_isMobile,
|
|
544
|
|
- _screenSharing
|
|
|
555
|
+ _screenSharing,
|
|
|
556
|
+ _reactionsEnabled
|
|
545
|
557
|
} = this.props;
|
|
546
|
558
|
|
|
547
|
559
|
const microphone = {
|
|
|
@@ -578,7 +590,8 @@ class Toolbox extends Component<Props> {
|
|
578
|
590
|
|
|
579
|
591
|
const raisehand = {
|
|
580
|
592
|
key: 'raisehand',
|
|
581
|
|
- Content: ReactionsMenuButton,
|
|
|
593
|
+ Content: _reactionsEnabled ? ReactionsMenuButton : RaiseHandButton,
|
|
|
594
|
+ handleClick: _reactionsEnabled ? null : this._onToolbarToggleRaiseHand,
|
|
582
|
595
|
group: 2
|
|
583
|
596
|
};
|
|
584
|
597
|
|
|
|
@@ -1054,6 +1067,23 @@ class Toolbox extends Component<Props> {
|
|
1054
|
1067
|
this._doToggleFullScreen();
|
|
1055
|
1068
|
}
|
|
1056
|
1069
|
|
|
|
1070
|
+ _onToolbarToggleRaiseHand: () => void;
|
|
|
1071
|
+
|
|
|
1072
|
+ /**
|
|
|
1073
|
+ * Creates an analytics toolbar event and dispatches an action for toggling
|
|
|
1074
|
+ * raise hand.
|
|
|
1075
|
+ *
|
|
|
1076
|
+ * @private
|
|
|
1077
|
+ * @returns {void}
|
|
|
1078
|
+ */
|
|
|
1079
|
+ _onToolbarToggleRaiseHand() {
|
|
|
1080
|
+ sendAnalytics(createToolbarEvent(
|
|
|
1081
|
+ 'raise.hand',
|
|
|
1082
|
+ { enable: !this.props._raisedHand }));
|
|
|
1083
|
+
|
|
|
1084
|
+ this._doToggleRaiseHand();
|
|
|
1085
|
+ }
|
|
|
1086
|
+
|
|
1057
|
1087
|
_onToolbarToggleScreenshare: () => void;
|
|
1058
|
1088
|
|
|
1059
|
1089
|
/**
|
|
|
@@ -1131,7 +1161,8 @@ class Toolbox extends Component<Props> {
|
|
1131
|
1161
|
_isMobile,
|
|
1132
|
1162
|
_overflowMenuVisible,
|
|
1133
|
1163
|
_toolbarButtons,
|
|
1134
|
|
- t
|
|
|
1164
|
+ t,
|
|
|
1165
|
+ _reactionsEnabled
|
|
1135
|
1166
|
} = this.props;
|
|
1136
|
1167
|
|
|
1137
|
1168
|
const toolbarAccLabel = 'toolbar.accessibilityLabel.moreActionsMenu';
|
|
|
@@ -1160,7 +1191,7 @@ class Toolbox extends Component<Props> {
|
|
1160
|
1191
|
key = 'overflow-menu'
|
|
1161
|
1192
|
onVisibilityChange = { this._onSetOverflowVisible }
|
|
1162
|
1193
|
showMobileReactions = {
|
|
1163
|
|
- overflowMenuButtons.find(({ key }) => key === 'raisehand')
|
|
|
1194
|
+ _reactionsEnabled && overflowMenuButtons.find(({ key }) => key === 'raisehand')
|
|
1164
|
1195
|
}>
|
|
1165
|
1196
|
<ul
|
|
1166
|
1197
|
aria-label = { t(toolbarAccLabel) }
|
|
|
@@ -1171,7 +1202,7 @@ class Toolbox extends Component<Props> {
|
|
1171
|
1202
|
{overflowMenuButtons.map(({ group, key, Content, ...rest }, index, arr) => {
|
|
1172
|
1203
|
const showSeparator = index > 0 && arr[index - 1].group !== group;
|
|
1173
|
1204
|
|
|
1174
|
|
- return key !== 'raisehand'
|
|
|
1205
|
+ return (key !== 'raisehand' || !_reactionsEnabled)
|
|
1175
|
1206
|
&& <>
|
|
1176
|
1207
|
{showSeparator && <Separator key = { `hr${group}` } />}
|
|
1177
|
1208
|
<Content
|
|
|
@@ -1218,6 +1249,7 @@ function _mapStateToProps(state) {
|
|
1218
|
1249
|
const localParticipant = getLocalParticipant(state);
|
|
1219
|
1250
|
const localVideo = getLocalVideoTrack(state['features/base/tracks']);
|
|
1220
|
1251
|
const { clientWidth } = state['features/base/responsive-ui'];
|
|
|
1252
|
+ const { enableReactions } = state['features/base/config'];
|
|
1221
|
1253
|
|
|
1222
|
1254
|
let desktopSharingDisabledTooltipKey;
|
|
1223
|
1255
|
|
|
|
@@ -1253,7 +1285,8 @@ function _mapStateToProps(state) {
|
|
1253
|
1285
|
_screenSharing: isScreenVideoShared(state),
|
|
1254
|
1286
|
_toolbarButtons: getToolbarButtons(state),
|
|
1255
|
1287
|
_visible: isToolboxVisible(state),
|
|
1256
|
|
- _visibleButtons: getToolbarButtons(state)
|
|
|
1288
|
+ _visibleButtons: getToolbarButtons(state),
|
|
|
1289
|
+ _reactionsEnabled: enableReactions
|
|
1257
|
1290
|
};
|
|
1258
|
1291
|
}
|
|
1259
|
1292
|
|