diff options
author | Joffrey BION <joffrey.bion@gmail.com> | 2017-05-13 22:18:56 +0200 |
---|---|---|
committer | Joffrey BION <joffrey.bion@gmail.com> | 2017-05-13 22:18:56 +0200 |
commit | e7606b72118f71097a0a7f75fb735750f905c24a (patch) | |
tree | 6cf01487cf2c669e6231c2c16ea3d50093319b0b /frontend/src/components | |
parent | Fix getPlayers that in fact takes an immutable List instead of JS array (diff) | |
download | seven-wonders-e7606b72118f71097a0a7f75fb735750f905c24a.tar.gz seven-wonders-e7606b72118f71097a0a7f75fb735750f905c24a.tar.bz2 seven-wonders-e7606b72118f71097a0a7f75fb735750f905c24a.zip |
Migrate to seamless immutable
Resolves:
https://github.com/luxons/seven-wonders/issues/6
Diffstat (limited to 'frontend/src/components')
-rw-r--r-- | frontend/src/components/gameList.js | 7 | ||||
-rw-r--r-- | frontend/src/components/playerList.js | 7 |
2 files changed, 8 insertions, 6 deletions
diff --git a/frontend/src/components/gameList.js b/frontend/src/components/gameList.js index c8720b26..f49a7589 100644 --- a/frontend/src/components/gameList.js +++ b/frontend/src/components/gameList.js @@ -1,15 +1,16 @@ import React from 'react' import { Flex } from 'reflexbox' import { Text, Space, Button } from 'rebass' +import Immutable from 'seamless-immutable' const GameList = (props) => ( <div> - {props.games.map((game, index) => { + {Immutable.asMutable(props.games).map((game, index) => { - const joinGame = () => props.joinGame(game.get('id')) + const joinGame = () => props.joinGame(game.id) return (<Flex key={index}> - <Text>{game.get('name')}</Text> + <Text>{game.name}</Text> <Space auto /> <Button onClick={joinGame}>Join</Button> </Flex>) diff --git a/frontend/src/components/playerList.js b/frontend/src/components/playerList.js index 30384d53..45aa01a2 100644 --- a/frontend/src/components/playerList.js +++ b/frontend/src/components/playerList.js @@ -1,13 +1,14 @@ import React from 'react' import { Flex } from 'reflexbox' import { Text } from 'rebass' +import Immutable from 'seamless-immutable' const PlayerList = (props) => ( <div> - {props.players.map((player, index) => { + {Immutable.asMutable(props.players).map((player, index) => { return (<Flex key={index}> - <Text>{player.get('displayName')}</Text> - <Text>({player.get('username')})</Text> + <Text>{player.displayName}</Text> + <Text>({player.username})</Text> </Flex>) })} </div> |