Browse Source

Merge pull request #8399 from jitsi/tavram/overflowmenu

fix(menu) do not display overflow menu button if no items
master
Avram Tudor 4 years ago
parent
commit
845e23a947
No account linked to committer's email address
1 changed files with 22 additions and 19 deletions
  1. 22
    19
      react/features/toolbox/components/web/Toolbox.js

+ 22
- 19
react/features/toolbox/components/web/Toolbox.js View File

1030
                     key = 'fullscreen'
1030
                     key = 'fullscreen'
1031
                     onClick = { this._onToolbarToggleFullScreen }
1031
                     onClick = { this._onToolbarToggleFullScreen }
1032
                     text = { _fullScreen ? t('toolbar.exitFullScreen') : t('toolbar.enterFullScreen') } />,
1032
                     text = { _fullScreen ? t('toolbar.exitFullScreen') : t('toolbar.enterFullScreen') } />,
1033
-            <LiveStreamButton
1034
-                key = 'livestreaming'
1035
-                showLabel = { true } />,
1036
-            <RecordButton
1037
-                key = 'record'
1038
-                showLabel = { true } />,
1033
+            this._shouldShowButton('livestreaming')
1034
+                && <LiveStreamButton
1035
+                    key = 'livestreaming'
1036
+                    showLabel = { true } />,
1037
+            this._shouldShowButton('recording')
1038
+                && <RecordButton
1039
+                    key = 'record'
1040
+                    showLabel = { true } />,
1039
             this._shouldShowButton('sharedvideo')
1041
             this._shouldShowButton('sharedvideo')
1040
                 && <OverflowMenuItem
1042
                 && <OverflowMenuItem
1041
                     accessibilityLabel = { t('toolbar.accessibilityLabel.sharedvideo') }
1043
                     accessibilityLabel = { t('toolbar.accessibilityLabel.sharedvideo') }
1047
                 && <SharedDocumentButton
1049
                 && <SharedDocumentButton
1048
                     key = 'etherpad'
1050
                     key = 'etherpad'
1049
                     showLabel = { true } />,
1051
                     showLabel = { true } />,
1050
-            <VideoBlurButton
1051
-                key = 'videobackgroundblur'
1052
-                showLabel = { true }
1053
-                visible = { this._shouldShowButton('videobackgroundblur') && !_screensharing } />,
1054
-            <SettingsButton
1055
-                key = 'settings'
1056
-                showLabel = { true }
1057
-                visible = { this._shouldShowButton('settings') } />,
1058
-            <MuteEveryoneButton
1059
-                key = 'mute-everyone'
1060
-                showLabel = { true }
1061
-                visible = { this._shouldShowButton('mute-everyone') } />,
1052
+            this._shouldShowButton('videobackgroundblur')
1053
+                && <VideoBlurButton
1054
+                    key = 'videobackgroundblur'
1055
+                    showLabel = { true }
1056
+                    visible = { !_screensharing } />,
1057
+            this._shouldShowButton('settings')
1058
+                && <SettingsButton
1059
+                    key = 'settings'
1060
+                    showLabel = { true } />,
1061
+            this._shouldShowButton('mute-everyone')
1062
+                && <MuteEveryoneButton
1063
+                    key = 'mute-everyone'
1064
+                    showLabel = { true } />,
1062
             this._shouldShowButton('stats')
1065
             this._shouldShowButton('stats')
1063
                 && <OverflowMenuItem
1066
                 && <OverflowMenuItem
1064
                     accessibilityLabel = { t('toolbar.accessibilityLabel.speakerStats') }
1067
                     accessibilityLabel = { t('toolbar.accessibilityLabel.speakerStats') }
1224
             t
1227
             t
1225
         } = this.props;
1228
         } = this.props;
1226
         const overflowMenuContent = this._renderOverflowMenuContent();
1229
         const overflowMenuContent = this._renderOverflowMenuContent();
1227
-        const overflowHasItems = Boolean(overflowMenuContent.length);
1230
+        const overflowHasItems = overflowMenuContent.some(item => Boolean(item));
1228
         const toolbarAccLabel = 'toolbar.accessibilityLabel.moreActionsMenu';
1231
         const toolbarAccLabel = 'toolbar.accessibilityLabel.moreActionsMenu';
1229
         const buttonsLeft = [];
1232
         const buttonsLeft = [];
1230
         const buttonsRight = [];
1233
         const buttonsRight = [];

Loading…
Cancel
Save