Archived
saving copy-pasta from ch. 9
This commit is contained in:
@@ -6,10 +6,21 @@ export const GameList = (props) => {
|
||||
|
||||
useEffect(() => {
|
||||
getGames().then(data => setGames(data))
|
||||
}, [])
|
||||
},
|
||||
[]
|
||||
)
|
||||
|
||||
return (
|
||||
<article className="games">
|
||||
<button className="btn btn-2 btn-sep icon-create"
|
||||
onClick={
|
||||
() => {
|
||||
history.push(
|
||||
{ pathname: "/games/new" }
|
||||
)
|
||||
}
|
||||
}
|
||||
>Register New Game</button>
|
||||
{
|
||||
games.map(game => {
|
||||
return <section key={`game--${game.id}`} className="game">
|
||||
|
||||
Reference in New Issue
Block a user