You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

MeetingParticipantItems.js 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. // @flow
  2. import React from 'react';
  3. import MeetingParticipantItem from './MeetingParticipantItem';
  4. type Props = {
  5. /**
  6. * The translated ask unmute text for the qiuck action buttons.
  7. */
  8. askUnmuteText: string,
  9. /**
  10. * Callback for the mouse leaving this item
  11. */
  12. lowerMenu: Function,
  13. /**
  14. * Callback for the activation of this item's context menu
  15. */
  16. toggleMenu: Function,
  17. /**
  18. * Callback used to open a confirmation dialog for audio muting.
  19. */
  20. muteAudio: Function,
  21. /**
  22. * The translated text for the mute participant button.
  23. */
  24. muteParticipantButtonText: string,
  25. /**
  26. * The meeting participants.
  27. */
  28. participantIds: Array<string>,
  29. /**
  30. * Callback used to open an actions drawer for a participant.
  31. */
  32. openDrawerForParticipant: Function,
  33. /**
  34. * True if an overflow drawer should be displayed.
  35. */
  36. overflowDrawer: boolean,
  37. /**
  38. * The if of the participant for which the context menu should be open.
  39. */
  40. raiseContextId?: string,
  41. /**
  42. * The aria-label for the ellipsis action.
  43. */
  44. participantActionEllipsisLabel: string,
  45. /**
  46. * Current search string.
  47. */
  48. searchString?: string,
  49. /**
  50. * The translated "you" text.
  51. */
  52. youText: string
  53. }
  54. /**
  55. * Component used to display a list of meeting participants.
  56. *
  57. * @returns {ReactNode}
  58. */
  59. function MeetingParticipantItems({
  60. askUnmuteText,
  61. lowerMenu,
  62. toggleMenu,
  63. muteAudio,
  64. muteParticipantButtonText,
  65. participantIds,
  66. openDrawerForParticipant,
  67. overflowDrawer,
  68. raiseContextId,
  69. participantActionEllipsisLabel,
  70. searchString,
  71. youText
  72. }: Props) {
  73. const renderParticipant = id => (
  74. <MeetingParticipantItem
  75. askUnmuteText = { askUnmuteText }
  76. isHighlighted = { raiseContextId === id }
  77. key = { id }
  78. muteAudio = { muteAudio }
  79. muteParticipantButtonText = { muteParticipantButtonText }
  80. onContextMenu = { toggleMenu(id) }
  81. onLeave = { lowerMenu }
  82. openDrawerForParticipant = { openDrawerForParticipant }
  83. overflowDrawer = { overflowDrawer }
  84. participantActionEllipsisLabel = { participantActionEllipsisLabel }
  85. participantID = { id }
  86. searchString = { searchString }
  87. youText = { youText } />
  88. );
  89. return participantIds.map(renderParticipant);
  90. }
  91. // Memoize the component in order to avoid rerender on drawer open/close.
  92. export default React.memo<Props>(MeetingParticipantItems);