Browse Source

feat(native-participants-pane) rendered participant name

master
Calin Chitu 4 years ago
parent
commit
cd05c34d19

+ 1
- 0
react/features/participants-pane/components/native/LobbyParticipantItem.js View File

@@ -29,6 +29,7 @@ export const LobbyParticipantItem = ({ participant: p }: Props) => {
29 29
     return (
30 30
         <ParticipantItem
31 31
             audioMuteState = { MediaState.Muted }
32
+            name = { p.name }
32 33
             participant = { p }
33 34
             videoMuteState = { MediaState.ForceMuted }>
34 35
             <View style = { styles.lobbyParticipantItem }>

+ 5
- 4
react/features/participants-pane/components/native/MeetingParticipantItem.js View File

@@ -20,14 +20,15 @@ type Props = {
20 20
     participant: Object
21 21
 };
22 22
 
23
-export const MeetingParticipantItem = ({ participant }: Props) => {
24
-    const isAudioMuted = useSelector(getIsParticipantAudioMuted(participant));
25
-    const isVideoMuted = useSelector(getIsParticipantVideoMuted(participant));
23
+export const MeetingParticipantItem = ({ participant: p }: Props) => {
24
+    const isAudioMuted = useSelector(getIsParticipantAudioMuted(p));
25
+    const isVideoMuted = useSelector(getIsParticipantVideoMuted(p));
26 26
 
27 27
     return (
28 28
         <ParticipantItem
29 29
             audioMuteState = { isAudioMuted ? MediaState.Muted : MediaState.Unmuted }
30
-            participant = { participant }
30
+            name = { p.name }
31
+            participant = { p }
31 32
             videoMuteState = { isVideoMuted ? MediaState.Muted : MediaState.Unmuted } />
32 33
     );
33 34
 };

+ 11
- 5
react/features/participants-pane/components/native/ParticipantItem.js View File

@@ -30,6 +30,11 @@ type Props = {
30 30
      */
31 31
     children?: Node,
32 32
 
33
+    /**
34
+     * The name of the participant. Used for showing lobby names.
35
+     */
36
+    name?: string,
37
+
33 38
     /**
34 39
      * Callback for when the mouse leaves this component
35 40
      */
@@ -52,13 +57,14 @@ type Props = {
52 57
  * @returns {React$Element<any>}
53 58
  */
54 59
 function ParticipantItem({
55
-    children,
56 60
     audioMuteState = MediaState.None,
57
-    videoMuteState = MediaState.None,
58
-    participant: p
61
+    children,
62
+    name,
63
+    participant: p,
64
+    videoMuteState = MediaState.None
59 65
 }: Props) {
66
+    const displayName = name || useSelector(getParticipantDisplayNameWithId(p.id));
60 67
     const { t } = useTranslation();
61
-    const name = useSelector(getParticipantDisplayNameWithId(p.id));
62 68
 
63 69
     return (
64 70
         <View style = { styles.participantContainer } >
@@ -69,7 +75,7 @@ function ParticipantItem({
69 75
             <View style = { styles.participantContent }>
70 76
                 <View style = { styles.participantNameContainer }>
71 77
                     <Text style = { styles.participantName }>
72
-                        { name }
78
+                        { displayName }
73 79
                     </Text>
74 80
                     { p.local ? <Text style = { styles.isLocal }>({t('chat.you')})</Text> : null }
75 81
                 </View>

+ 3
- 4
react/features/participants-pane/components/native/styles.js View File

@@ -12,8 +12,8 @@ const participantState = {
12 12
  * The style for participant list.
13 13
  */
14 14
 const participantList = {
15
-    marginLeft: BaseTheme.spacing[4],
16
-    marginRight: BaseTheme.spacing[4],
15
+    marginLeft: BaseTheme.spacing[3],
16
+    marginRight: BaseTheme.spacing[3],
17 17
     position: 'relative'
18 18
 };
19 19
 
@@ -205,8 +205,7 @@ export default {
205 205
     },
206 206
 
207 207
     lobbyListActions: {
208
-        flexDirection: 'row',
209
-        right: BaseTheme.spacing[2]
208
+        flexDirection: 'row'
210 209
     },
211 210
 
212 211
     header: {

Loading…
Cancel
Save