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.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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. * The translated "you" text.
  47. */
  48. youText: string
  49. }
  50. /**
  51. * Component used to display a list of meeting participants.
  52. *
  53. * @returns {ReactNode}
  54. */
  55. function MeetingParticipantItems({
  56. askUnmuteText,
  57. lowerMenu,
  58. toggleMenu,
  59. muteAudio,
  60. muteParticipantButtonText,
  61. participantIds,
  62. openDrawerForParticipant,
  63. overflowDrawer,
  64. raiseContextId,
  65. participantActionEllipsisLabel,
  66. youText
  67. }) {
  68. const renderParticipant = id => (
  69. <MeetingParticipantItem
  70. askUnmuteText = { askUnmuteText }
  71. isHighlighted = { raiseContextId === id }
  72. key = { id }
  73. muteAudio = { muteAudio }
  74. muteParticipantButtonText = { muteParticipantButtonText }
  75. onContextMenu = { toggleMenu(id) }
  76. onLeave = { lowerMenu }
  77. openDrawerForParticipant = { openDrawerForParticipant }
  78. overflowDrawer = { overflowDrawer }
  79. participantActionEllipsisLabel = { participantActionEllipsisLabel }
  80. participantID = { id }
  81. youText = { youText } />
  82. );
  83. return participantIds.map(renderParticipant);
  84. }
  85. // Memoize the component in order to avoid rerender on drawer open/close.
  86. export default React.memo<Props>(MeetingParticipantItems);