Browse Source

thumbnail: use a more explicit prop

master
Saúl Ibarra Corretgé 6 years ago
parent
commit
1b27e331da
1 changed files with 17 additions and 14 deletions
  1. 17
    14
      react/features/filmstrip/components/native/Thumbnail.js

+ 17
- 14
react/features/filmstrip/components/native/Thumbnail.js View File

40
      */
40
      */
41
     _audioTrack: Object,
41
     _audioTrack: Object,
42
 
42
 
43
-    /**
44
-     * True if everone in the meeting is moderator.
45
-     */
46
-    _isEveryoneModerator: boolean,
47
-
48
     /**
43
     /**
49
      * The Redux representation of the state "features/large-video".
44
      * The Redux representation of the state "features/large-video".
50
      */
45
      */
63
     /**
58
     /**
64
      * Whether to show the dominant speaker indicator or not.
59
      * Whether to show the dominant speaker indicator or not.
65
      */
60
      */
66
-    _showDominantSpeakerIndicator: boolean,
61
+    _renderDominantSpeakerIndicator: boolean,
62
+
63
+    /**
64
+     * Whether to show the moderator indicator or not.
65
+     */
66
+    _renderModeratorIndicator: boolean,
67
 
67
 
68
     /**
68
     /**
69
      * The color-schemed stylesheet of the feature.
69
      * The color-schemed stylesheet of the feature.
123
     render() {
123
     render() {
124
         const {
124
         const {
125
             _audioTrack: audioTrack,
125
             _audioTrack: audioTrack,
126
-            _isEveryoneModerator,
127
             _largeVideo: largeVideo,
126
             _largeVideo: largeVideo,
128
             _onClick,
127
             _onClick,
129
             _onShowRemoteVideoMenu,
128
             _onShowRemoteVideoMenu,
130
-            _showDominantSpeakerIndicator: showDominantSpeakerIndicator,
129
+            _renderDominantSpeakerIndicator: renderDominantSpeakerIndicator,
130
+            _renderModeratorIndicator: renderModeratorIndicator,
131
             _styles,
131
             _styles,
132
             _videoTrack: videoTrack,
132
             _videoTrack: videoTrack,
133
             disableTint,
133
             disableTint,
178
 
178
 
179
                 { renderDisplayName && <DisplayNameLabel participantId = { participantId } /> }
179
                 { renderDisplayName && <DisplayNameLabel participantId = { participantId } /> }
180
 
180
 
181
-                { !_isEveryoneModerator && participant.role === PARTICIPANT_ROLE.MODERATOR
181
+                { renderModeratorIndicator
182
                     && <View style = { styles.moderatorIndicatorContainer }>
182
                     && <View style = { styles.moderatorIndicatorContainer }>
183
                         <ModeratorIndicator />
183
                         <ModeratorIndicator />
184
                     </View> }
184
                     </View> }
189
                         styles.thumbnailTopLeftIndicatorContainer
189
                         styles.thumbnailTopLeftIndicatorContainer
190
                     ] }>
190
                     ] }>
191
                     <RaisedHandIndicator participantId = { participant.id } />
191
                     <RaisedHandIndicator participantId = { participant.id } />
192
-                    { showDominantSpeakerIndicator && <DominantSpeakerIndicator /> }
192
+                    { renderDominantSpeakerIndicator && <DominantSpeakerIndicator /> }
193
                 </View>
193
                 </View>
194
 
194
 
195
                 <View
195
                 <View
269
     // the stage i.e. as a large video.
269
     // the stage i.e. as a large video.
270
     const largeVideo = state['features/large-video'];
270
     const largeVideo = state['features/large-video'];
271
     const tracks = state['features/base/tracks'];
271
     const tracks = state['features/base/tracks'];
272
-    const id = ownProps.participant.id;
272
+    const { participant } = ownProps;
273
+    const id = participant.id;
273
     const audioTrack
274
     const audioTrack
274
         = getTrackByMediaTypeAndParticipant(tracks, MEDIA_TYPE.AUDIO, id);
275
         = getTrackByMediaTypeAndParticipant(tracks, MEDIA_TYPE.AUDIO, id);
275
     const videoTrack
276
     const videoTrack
276
         = getTrackByMediaTypeAndParticipant(tracks, MEDIA_TYPE.VIDEO, id);
277
         = getTrackByMediaTypeAndParticipant(tracks, MEDIA_TYPE.VIDEO, id);
277
     const participantCount = getParticipantCount(state);
278
     const participantCount = getParticipantCount(state);
278
-    const showDominantSpeakerIndicator = ownProps.participant.dominantSpeaker && participantCount > 2;
279
+    const renderDominantSpeakerIndicator = participant.dominantSpeaker && participantCount > 2;
280
+    const _isEveryoneModerator = isEveryoneModerator(state);
281
+    const renderModeratorIndicator = !_isEveryoneModerator && participant.role === PARTICIPANT_ROLE.MODERATOR;
279
 
282
 
280
     return {
283
     return {
281
         _audioTrack: audioTrack,
284
         _audioTrack: audioTrack,
282
-        _isEveryoneModerator: isEveryoneModerator(state),
283
         _largeVideo: largeVideo,
285
         _largeVideo: largeVideo,
284
-        _showDominantSpeakerIndicator: showDominantSpeakerIndicator,
286
+        _renderDominantSpeakerIndicator: renderDominantSpeakerIndicator,
287
+        _renderModeratorIndicator: renderModeratorIndicator,
285
         _styles: ColorSchemeRegistry.get(state, 'Thumbnail'),
288
         _styles: ColorSchemeRegistry.get(state, 'Thumbnail'),
286
         _videoTrack: videoTrack
289
         _videoTrack: videoTrack
287
     };
290
     };

Loading…
Cancel
Save