ソースを参照

feat(native-participants-pane) rendered participant name

master
Calin Chitu 4年前
コミット
cd05c34d19

+ 1
- 0
react/features/participants-pane/components/native/LobbyParticipantItem.js ファイルの表示

29
     return (
29
     return (
30
         <ParticipantItem
30
         <ParticipantItem
31
             audioMuteState = { MediaState.Muted }
31
             audioMuteState = { MediaState.Muted }
32
+            name = { p.name }
32
             participant = { p }
33
             participant = { p }
33
             videoMuteState = { MediaState.ForceMuted }>
34
             videoMuteState = { MediaState.ForceMuted }>
34
             <View style = { styles.lobbyParticipantItem }>
35
             <View style = { styles.lobbyParticipantItem }>

+ 5
- 4
react/features/participants-pane/components/native/MeetingParticipantItem.js ファイルの表示

20
     participant: Object
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
     return (
27
     return (
28
         <ParticipantItem
28
         <ParticipantItem
29
             audioMuteState = { isAudioMuted ? MediaState.Muted : MediaState.Unmuted }
29
             audioMuteState = { isAudioMuted ? MediaState.Muted : MediaState.Unmuted }
30
-            participant = { participant }
30
+            name = { p.name }
31
+            participant = { p }
31
             videoMuteState = { isVideoMuted ? MediaState.Muted : MediaState.Unmuted } />
32
             videoMuteState = { isVideoMuted ? MediaState.Muted : MediaState.Unmuted } />
32
     );
33
     );
33
 };
34
 };

+ 11
- 5
react/features/participants-pane/components/native/ParticipantItem.js ファイルの表示

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

+ 3
- 4
react/features/participants-pane/components/native/styles.js ファイルの表示

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

読み込み中…
キャンセル
保存