fix(menu) do not display overflow menu button if no items

This commit is contained in:
Tudor-Ovidiu Avram 2021-01-13 11:55:38 +02:00
parent db48dc3ed3
commit 8d3d94f568
1 changed files with 22 additions and 19 deletions

View File

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