2021-09-10 11:05:16 +00:00
|
|
|
// @flow
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
|
|
|
|
import MeetingParticipantItem from './MeetingParticipantItem';
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The translated ask unmute text for the qiuck action buttons.
|
|
|
|
*/
|
|
|
|
askUnmuteText: string,
|
|
|
|
|
2022-02-14 14:47:14 +00:00
|
|
|
/**
|
|
|
|
* Whether or not the local participant is in a breakout room.
|
|
|
|
*/
|
|
|
|
isInBreakoutRoom: boolean,
|
|
|
|
|
2021-09-10 11:05:16 +00:00
|
|
|
/**
|
2021-11-04 21:10:43 +00:00
|
|
|
* Callback for the mouse leaving this item.
|
2021-09-10 11:05:16 +00:00
|
|
|
*/
|
|
|
|
lowerMenu: Function,
|
|
|
|
|
|
|
|
/**
|
2021-11-04 21:10:43 +00:00
|
|
|
* Callback for the activation of this item's context menu.
|
2021-09-10 11:05:16 +00:00
|
|
|
*/
|
|
|
|
toggleMenu: Function,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Callback used to open a confirmation dialog for audio muting.
|
|
|
|
*/
|
|
|
|
muteAudio: Function,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The translated text for the mute participant button.
|
|
|
|
*/
|
|
|
|
muteParticipantButtonText: string,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The meeting participants.
|
|
|
|
*/
|
2022-02-14 14:47:14 +00:00
|
|
|
participantIds: Array<string>,
|
2021-09-10 11:05:16 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Callback used to open an actions drawer for a participant.
|
|
|
|
*/
|
|
|
|
openDrawerForParticipant: Function,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* True if an overflow drawer should be displayed.
|
|
|
|
*/
|
|
|
|
overflowDrawer: boolean,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The if of the participant for which the context menu should be open.
|
|
|
|
*/
|
|
|
|
raiseContextId?: string,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The aria-label for the ellipsis action.
|
|
|
|
*/
|
|
|
|
participantActionEllipsisLabel: string,
|
|
|
|
|
2021-10-21 11:58:44 +00:00
|
|
|
/**
|
|
|
|
* Current search string.
|
|
|
|
*/
|
|
|
|
searchString?: string,
|
|
|
|
|
2021-09-10 11:05:16 +00:00
|
|
|
/**
|
|
|
|
* The translated "you" text.
|
|
|
|
*/
|
|
|
|
youText: string
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Component used to display a list of meeting participants.
|
|
|
|
*
|
|
|
|
* @returns {ReactNode}
|
|
|
|
*/
|
|
|
|
function MeetingParticipantItems({
|
|
|
|
askUnmuteText,
|
2022-02-14 14:47:14 +00:00
|
|
|
isInBreakoutRoom,
|
2021-09-10 11:05:16 +00:00
|
|
|
lowerMenu,
|
|
|
|
toggleMenu,
|
|
|
|
muteAudio,
|
|
|
|
muteParticipantButtonText,
|
|
|
|
participantIds,
|
|
|
|
openDrawerForParticipant,
|
|
|
|
overflowDrawer,
|
|
|
|
raiseContextId,
|
|
|
|
participantActionEllipsisLabel,
|
2021-10-21 11:58:44 +00:00
|
|
|
searchString,
|
2021-09-10 11:05:16 +00:00
|
|
|
youText
|
2021-10-21 11:58:44 +00:00
|
|
|
}: Props) {
|
2021-09-10 11:05:16 +00:00
|
|
|
const renderParticipant = id => (
|
|
|
|
<MeetingParticipantItem
|
|
|
|
askUnmuteText = { askUnmuteText }
|
|
|
|
isHighlighted = { raiseContextId === id }
|
2022-02-14 14:47:14 +00:00
|
|
|
isInBreakoutRoom = { isInBreakoutRoom }
|
2021-09-10 11:05:16 +00:00
|
|
|
key = { id }
|
|
|
|
muteAudio = { muteAudio }
|
|
|
|
muteParticipantButtonText = { muteParticipantButtonText }
|
|
|
|
onContextMenu = { toggleMenu(id) }
|
|
|
|
onLeave = { lowerMenu }
|
|
|
|
openDrawerForParticipant = { openDrawerForParticipant }
|
|
|
|
overflowDrawer = { overflowDrawer }
|
|
|
|
participantActionEllipsisLabel = { participantActionEllipsisLabel }
|
|
|
|
participantID = { id }
|
2021-10-21 11:58:44 +00:00
|
|
|
searchString = { searchString }
|
2021-09-10 11:05:16 +00:00
|
|
|
youText = { youText } />
|
|
|
|
);
|
|
|
|
|
|
|
|
return participantIds.map(renderParticipant);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Memoize the component in order to avoid rerender on drawer open/close.
|
|
|
|
export default React.memo<Props>(MeetingParticipantItems);
|