Merge pull request #8399 from jitsi/tavram/overflowmenu

fix(menu) do not display overflow menu button if no items
This commit is contained in:
Avram Tudor 2021-01-13 12:39:11 +02:00 committed by GitHub
commit 845e23a947
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 22 additions and 19 deletions

View File

@ -1030,10 +1030,12 @@ class Toolbox extends Component<Props, State> {
key = 'fullscreen' key = 'fullscreen'
onClick = { this._onToolbarToggleFullScreen } onClick = { this._onToolbarToggleFullScreen }
text = { _fullScreen ? t('toolbar.exitFullScreen') : t('toolbar.enterFullScreen') } />, text = { _fullScreen ? t('toolbar.exitFullScreen') : t('toolbar.enterFullScreen') } />,
<LiveStreamButton this._shouldShowButton('livestreaming')
&& <LiveStreamButton
key = 'livestreaming' key = 'livestreaming'
showLabel = { true } />, showLabel = { true } />,
<RecordButton this._shouldShowButton('recording')
&& <RecordButton
key = 'record' key = 'record'
showLabel = { true } />, showLabel = { true } />,
this._shouldShowButton('sharedvideo') this._shouldShowButton('sharedvideo')
@ -1047,18 +1049,19 @@ class Toolbox extends Component<Props, State> {
&& <SharedDocumentButton && <SharedDocumentButton
key = 'etherpad' key = 'etherpad'
showLabel = { true } />, showLabel = { true } />,
<VideoBlurButton this._shouldShowButton('videobackgroundblur')
&& <VideoBlurButton
key = 'videobackgroundblur' key = 'videobackgroundblur'
showLabel = { true } showLabel = { true }
visible = { this._shouldShowButton('videobackgroundblur') && !_screensharing } />, visible = { !_screensharing } />,
<SettingsButton this._shouldShowButton('settings')
&& <SettingsButton
key = 'settings' key = 'settings'
showLabel = { true } showLabel = { true } />,
visible = { this._shouldShowButton('settings') } />, this._shouldShowButton('mute-everyone')
<MuteEveryoneButton && <MuteEveryoneButton
key = 'mute-everyone' key = 'mute-everyone'
showLabel = { true } showLabel = { true } />,
visible = { this._shouldShowButton('mute-everyone') } />,
this._shouldShowButton('stats') this._shouldShowButton('stats')
&& <OverflowMenuItem && <OverflowMenuItem
accessibilityLabel = { t('toolbar.accessibilityLabel.speakerStats') } accessibilityLabel = { t('toolbar.accessibilityLabel.speakerStats') }
@ -1224,7 +1227,7 @@ class Toolbox extends Component<Props, State> {
t t
} = this.props; } = this.props;
const overflowMenuContent = this._renderOverflowMenuContent(); const overflowMenuContent = this._renderOverflowMenuContent();
const overflowHasItems = Boolean(overflowMenuContent.length); const overflowHasItems = overflowMenuContent.some(item => Boolean(item));
const toolbarAccLabel = 'toolbar.accessibilityLabel.moreActionsMenu'; const toolbarAccLabel = 'toolbar.accessibilityLabel.moreActionsMenu';
const buttonsLeft = []; const buttonsLeft = [];
const buttonsRight = []; const buttonsRight = [];