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.

LobbyParticipantItems.js 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // @flow
  2. import React from 'react';
  3. import { LobbyParticipantItem } from './LobbyParticipantItem';
  4. type Props = {
  5. /**
  6. * Opens a drawer with actions for a knocking participant.
  7. */
  8. openDrawerForParticipant: Function,
  9. /**
  10. * If a drawer with actions should be displayed.
  11. */
  12. overflowDrawer: boolean,
  13. /**
  14. * List with the knocking participants.
  15. */
  16. participants: Array<Object>
  17. }
  18. /**
  19. * Component used to display a list of knocking participants.
  20. *
  21. * @param {Object} props - The props of the component.
  22. * @returns {ReactNode}
  23. */
  24. function LobbyParticipantItems({ openDrawerForParticipant, overflowDrawer, participants }: Props) {
  25. return (
  26. <div>
  27. {participants.map(p => (
  28. <LobbyParticipantItem
  29. key = { p.id }
  30. openDrawerForParticipant = { openDrawerForParticipant }
  31. overflowDrawer = { overflowDrawer }
  32. participant = { p } />)
  33. )}
  34. </div>
  35. );
  36. }
  37. // Memoize the component in order to avoid rerender on drawer open/close.
  38. export default React.memo<Props>(LobbyParticipantItems);