blob: b4167927f2a9db076de772c57c19783501993b54 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
import React from 'react'
import { Flex } from 'reflexbox'
import { Text, Space, Button } from 'rebass'
import Immutable from 'seamless-immutable'
const GameList = (props) => (
<div>
{Immutable.asMutable(props.games).map((game, index) => {
const joinGame = () => props.joinGame(game.id)
return (<Flex key={index}>
<Text>{game.name}</Text>
<Space auto />
<Button onClick={joinGame}>Join</Button>
</Flex>)
})}
</div>
)
export default GameList
|