fix(participants): Knocking participant name in participants list

Fixes https://github.com/jitsi/jitsi-meet/issues/9211
This commit is contained in:
Vlad Piersec 2021-05-17 11:10:17 +03:00 committed by vp8x8
parent 2a37f7caa8
commit 3f7073c589
2 changed files with 9 additions and 2 deletions

View File

@ -28,6 +28,7 @@ export const LobbyParticipantItem = ({ participant: p }: Props) => {
<ParticipantItem <ParticipantItem
actionsTrigger = { ActionTrigger.Permanent } actionsTrigger = { ActionTrigger.Permanent }
audioMuteState = { MediaState.None } audioMuteState = { MediaState.None }
name = { p.name }
participant = { p } participant = { p }
videoMuteState = { MediaState.None }> videoMuteState = { MediaState.None }>
<ParticipantActionButton <ParticipantActionButton

View File

@ -100,6 +100,11 @@ type Props = {
*/ */
isHighlighted?: boolean, isHighlighted?: boolean,
/**
* The name of the participant. Used for showing lobby names.
*/
name?: string,
/** /**
* Callback for when the mouse leaves this component * Callback for when the mouse leaves this component
*/ */
@ -123,11 +128,12 @@ export const ParticipantItem = ({
actionsTrigger = ActionTrigger.Hover, actionsTrigger = ActionTrigger.Hover,
audioMuteState = MediaState.None, audioMuteState = MediaState.None,
videoMuteState = MediaState.None, videoMuteState = MediaState.None,
name,
participant: p participant: p
}: Props) => { }: Props) => {
const ParticipantActions = Actions[actionsTrigger]; const ParticipantActions = Actions[actionsTrigger];
const { t } = useTranslation(); const { t } = useTranslation();
const name = useSelector(getParticipantDisplayNameWithId(p.id)); const displayName = name || useSelector(getParticipantDisplayNameWithId(p.id));
return ( return (
<ParticipantContainer <ParticipantContainer
@ -141,7 +147,7 @@ export const ParticipantItem = ({
<ParticipantContent> <ParticipantContent>
<ParticipantNameContainer> <ParticipantNameContainer>
<ParticipantName> <ParticipantName>
{ name } { displayName }
</ParticipantName> </ParticipantName>
{ p.local ? <span>&nbsp;({t('chat.you')})</span> : null } { p.local ? <span>&nbsp;({t('chat.you')})</span> : null }
</ParticipantNameContainer> </ParticipantNameContainer>