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,12 +1030,14 @@ 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')
key = 'livestreaming' && <LiveStreamButton
showLabel = { true } />, key = 'livestreaming'
<RecordButton showLabel = { true } />,
key = 'record' this._shouldShowButton('recording')
showLabel = { true } />, && <RecordButton
key = 'record'
showLabel = { true } />,
this._shouldShowButton('sharedvideo') this._shouldShowButton('sharedvideo')
&& <OverflowMenuItem && <OverflowMenuItem
accessibilityLabel = { t('toolbar.accessibilityLabel.sharedvideo') } accessibilityLabel = { t('toolbar.accessibilityLabel.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')
key = 'videobackgroundblur' && <VideoBlurButton
showLabel = { true } key = 'videobackgroundblur'
visible = { this._shouldShowButton('videobackgroundblur') && !_screensharing } />, showLabel = { true }
<SettingsButton visible = { !_screensharing } />,
key = 'settings' this._shouldShowButton('settings')
showLabel = { true } && <SettingsButton
visible = { this._shouldShowButton('settings') } />, key = 'settings'
<MuteEveryoneButton showLabel = { true } />,
key = 'mute-everyone' this._shouldShowButton('mute-everyone')
showLabel = { true } && <MuteEveryoneButton
visible = { this._shouldShowButton('mute-everyone') } />, key = 'mute-everyone'
showLabel = { true } />,
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 = [];