LobbyPlayerList.jsx 667 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import React from "react";
  2. import styled from "styled-components";
  3. const PlayerListContainer = styled.div`
  4. flex: 1;
  5. display: flex;
  6. flex-flow: column nowrap;
  7. justify-content: flex-start;
  8. align-items: flex-start;
  9. border-left: 2px solid #777;
  10. height: 100%;
  11. padding-left: 1rem;
  12. `
  13. const Label = styled.span`
  14. padding: 0.2em;
  15. `
  16. const PlayerList = styled.ul`
  17. `
  18. const PlayerName = styled.li`
  19. `
  20. export default ({ playerNames }) => (
  21. <PlayerListContainer>
  22. <Label>Players</Label>
  23. <PlayerList>
  24. {
  25. playerNames
  26. .map(name => <PlayerName key={name}>{name}</PlayerName>)
  27. }
  28. </PlayerList>
  29. </PlayerListContainer>
  30. );