From 1b27e331da3a38dfcc046c8f78ddfb45b905c2ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Fri, 13 Sep 2019 11:51:49 +0200 Subject: [PATCH] thumbnail: use a more explicit prop --- .../filmstrip/components/native/Thumbnail.js | 31 ++++++++++--------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/react/features/filmstrip/components/native/Thumbnail.js b/react/features/filmstrip/components/native/Thumbnail.js index b2e8532cd..7135090d3 100644 --- a/react/features/filmstrip/components/native/Thumbnail.js +++ b/react/features/filmstrip/components/native/Thumbnail.js @@ -40,11 +40,6 @@ type Props = { */ _audioTrack: Object, - /** - * True if everone in the meeting is moderator. - */ - _isEveryoneModerator: boolean, - /** * The Redux representation of the state "features/large-video". */ @@ -63,7 +58,12 @@ type Props = { /** * Whether to show the dominant speaker indicator or not. */ - _showDominantSpeakerIndicator: boolean, + _renderDominantSpeakerIndicator: boolean, + + /** + * Whether to show the moderator indicator or not. + */ + _renderModeratorIndicator: boolean, /** * The color-schemed stylesheet of the feature. @@ -123,11 +123,11 @@ class Thumbnail extends Component { render() { const { _audioTrack: audioTrack, - _isEveryoneModerator, _largeVideo: largeVideo, _onClick, _onShowRemoteVideoMenu, - _showDominantSpeakerIndicator: showDominantSpeakerIndicator, + _renderDominantSpeakerIndicator: renderDominantSpeakerIndicator, + _renderModeratorIndicator: renderModeratorIndicator, _styles, _videoTrack: videoTrack, disableTint, @@ -178,7 +178,7 @@ class Thumbnail extends Component { { renderDisplayName && } - { !_isEveryoneModerator && participant.role === PARTICIPANT_ROLE.MODERATOR + { renderModeratorIndicator && } @@ -189,7 +189,7 @@ class Thumbnail extends Component { styles.thumbnailTopLeftIndicatorContainer ] }> - { showDominantSpeakerIndicator && } + { renderDominantSpeakerIndicator && } 2; + const renderDominantSpeakerIndicator = participant.dominantSpeaker && participantCount > 2; + const _isEveryoneModerator = isEveryoneModerator(state); + const renderModeratorIndicator = !_isEveryoneModerator && participant.role === PARTICIPANT_ROLE.MODERATOR; return { _audioTrack: audioTrack, - _isEveryoneModerator: isEveryoneModerator(state), _largeVideo: largeVideo, - _showDominantSpeakerIndicator: showDominantSpeakerIndicator, + _renderDominantSpeakerIndicator: renderDominantSpeakerIndicator, + _renderModeratorIndicator: renderModeratorIndicator, _styles: ColorSchemeRegistry.get(state, 'Thumbnail'), _videoTrack: videoTrack };