diff options
author | Victor Chabbert <chabbertvi@eisti.eu> | 2017-05-28 20:42:21 +0200 |
---|---|---|
committer | Victor Chabbert <chabbertvi@eisti.eu> | 2017-05-28 20:42:21 +0200 |
commit | 0bf423172ffb2e4030b521b0985d133cb5c61dd9 (patch) | |
tree | 0c24821770274a414f80b3092d5be54902c042d9 /frontend/src/components | |
parent | Fix proxy not working since CRA upgrade (diff) | |
download | seven-wonders-0bf423172ffb2e4030b521b0985d133cb5c61dd9.tar.gz seven-wonders-0bf423172ffb2e4030b521b0985d133cb5c61dd9.tar.bz2 seven-wonders-0bf423172ffb2e4030b521b0985d133cb5c61dd9.zip |
Move to immutable with Records
Diffstat (limited to 'frontend/src/components')
-rw-r--r-- | frontend/src/components/gameList.js | 9 | ||||
-rw-r--r-- | frontend/src/components/playerList.js | 5 |
2 files changed, 5 insertions, 9 deletions
diff --git a/frontend/src/components/gameList.js b/frontend/src/components/gameList.js index f3a0d381..17dad16f 100644 --- a/frontend/src/components/gameList.js +++ b/frontend/src/components/gameList.js @@ -1,18 +1,15 @@ import React from 'react'; import { Flex } from 'reflexbox'; import { Text, Space, Button } from 'rebass'; -import Immutable from 'seamless-immutable'; -const GameList = props => ( +const GameList = ({ games, joinGame }) => ( <div> - {Immutable.asMutable(props.games).map((game, index) => { - const joinGame = () => props.joinGame(game.id); - + {games.map((game, index) => { return ( <Flex key={index}> <Text>{game.name}</Text> <Space auto /> - <Button onClick={joinGame}>Join</Button> + <Button onClick={() => joinGame(game.id)}>Join</Button> </Flex> ); })} diff --git a/frontend/src/components/playerList.js b/frontend/src/components/playerList.js index 1a68b067..bc2c768e 100644 --- a/frontend/src/components/playerList.js +++ b/frontend/src/components/playerList.js @@ -1,11 +1,10 @@ import React from 'react'; import { Flex } from 'reflexbox'; import { Text } from 'rebass'; -import Immutable from 'seamless-immutable'; -const PlayerList = props => ( +const PlayerList = ({ players }) => ( <div> - {Immutable.asMutable(props.players).map(player => { + {players.map(player => { return ( <Flex key={player.index}> <Text>{player.displayName}</Text> |