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.

LobbyParticipantList.js 890B

1234567891011121314151617181920212223242526272829303132333435
  1. // @flow
  2. import React from 'react';
  3. import { useTranslation } from 'react-i18next';
  4. import { useSelector } from 'react-redux';
  5. import { getLobbyState } from '../../lobby/functions';
  6. import { LobbyParticipantItem } from './LobbyParticipantItem';
  7. import { Heading } from './styled';
  8. export const LobbyParticipantList = () => {
  9. const {
  10. lobbyEnabled,
  11. knockingParticipants: participants
  12. } = useSelector(getLobbyState);
  13. const { t } = useTranslation();
  14. if (!lobbyEnabled || !participants.length) {
  15. return null;
  16. }
  17. return (
  18. <>
  19. <Heading>{t('participantsPane.headings.lobby', { count: participants.length })}</Heading>
  20. <div>
  21. {participants.map(p => (
  22. <LobbyParticipantItem
  23. key = { p.id }
  24. participant = { p } />)
  25. )}
  26. </div>
  27. </>
  28. );
  29. };