summaryrefslogtreecommitdiff
path: root/frontend/src/components/gameList.js
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/components/gameList.js')
-rw-r--r--frontend/src/components/gameList.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/frontend/src/components/gameList.js b/frontend/src/components/gameList.js
index 17dad16f..22366c5c 100644
--- a/frontend/src/components/gameList.js
+++ b/frontend/src/components/gameList.js
@@ -1,12 +1,16 @@
+// @flow
import React from 'react';
import { Flex } from 'reflexbox';
import { Text, Space, Button } from 'rebass';
-const GameList = ({ games, joinGame }) => (
+import type { List } from 'immutable';
+import type { Game } from '../models/games';
+
+const GameList = ({ games, joinGame }: { games: List<Game>, joinGame: (gameId: string) => void }) => (
<div>
- {games.map((game, index) => {
+ {games.map((game: Game, index: number) => {
return (
- <Flex key={index}>
+ <Flex key={game.get('displayName', index)}>
<Text>{game.name}</Text>
<Space auto />
<Button onClick={() => joinGame(game.id)}>Join</Button>
bgstack15