summaryrefslogtreecommitdiff
path: root/frontend/src/components/game/Board.jsx
diff options
context:
space:
mode:
authorjbion <joffrey.bion@amadeus.com>2019-02-26 22:12:37 +0100
committerjbion <joffrey.bion@amadeus.com>2019-02-26 22:12:37 +0100
commit20625511ff872404e70984f5b21e3f514793c511 (patch)
tree521803194965ae4ef633f4c12003472d573c4b84 /frontend/src/components/game/Board.jsx
parentAdd board and played cards (diff)
downloadseven-wonders-20625511ff872404e70984f5b21e3f514793c511.tar.gz
seven-wonders-20625511ff872404e70984f5b21e3f514793c511.tar.bz2
seven-wonders-20625511ff872404e70984f5b21e3f514793c511.zip
Add support for multiple columns
Diffstat (limited to 'frontend/src/components/game/Board.jsx')
-rw-r--r--frontend/src/components/game/Board.jsx11
1 files changed, 5 insertions, 6 deletions
diff --git a/frontend/src/components/game/Board.jsx b/frontend/src/components/game/Board.jsx
index 9c5db971..b29b847f 100644
--- a/frontend/src/components/game/Board.jsx
+++ b/frontend/src/components/game/Board.jsx
@@ -5,7 +5,7 @@ import { CardImage } from './CardImage';
// card offsets in % of their size when displayed in columns
const xOffset = 20;
-const yOffset = 23;
+const yOffset = 21;
type BoardProps = {
board: ApiBoard,
@@ -13,19 +13,18 @@ type BoardProps = {
export const Board = ({board}: BoardProps) => {
return <div className='board'>
- <TableCards cards={board.playedCards}/>
+ <TableCards cardColumns={board.playedCards}/>
<Wonder wonder={board.wonder}/>
</div>;
};
type TableCardsProps = {
- cards: ApiTableCard[],
+ cardColumns: ApiTableCard[][],
}
-const TableCards = ({cards}: TableCardsProps) => {
- // TODO split cards into multiple columns
+const TableCards = ({cardColumns}: TableCardsProps) => {
return <div className="cards">
- <TableCardColumn cards={cards}/>
+ {cardColumns.map(column => <TableCardColumn key={column[0].color} cards={column}/>)}
</div>
};
bgstack15