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