forked from Roflin/gamenight
Gamenights also return their game list.
This commit is contained in:
27
frontend/src/components/Gamenight.jsx
Normal file
27
frontend/src/components/Gamenight.jsx
Normal file
@@ -0,0 +1,27 @@
|
||||
import * as React from 'react';
|
||||
|
||||
function Gamenight(props) {
|
||||
|
||||
console.log(props.gamenight);
|
||||
|
||||
let games = props.gamenight.game_list.map(g =>
|
||||
(
|
||||
<li>
|
||||
<span>{g.name}</span>
|
||||
</li>
|
||||
)
|
||||
);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<button onClick={props.onDismis(null)}>x</button>
|
||||
<h3>{props.gamenight.name}</h3>
|
||||
<span>{props.gamenight.datetime}</span>
|
||||
<ul>
|
||||
{games}
|
||||
</ul>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default Gamenight
|
||||
@@ -33,7 +33,7 @@ function Gamenights(props) {
|
||||
|
||||
let gamenights = props.gamenights.map(g =>
|
||||
(
|
||||
<li>
|
||||
<li onClick={(e) => {console.log(g); props.setActiveGamenight(g);}}>
|
||||
<span>{g.name}</span>
|
||||
{(props.user.id === g.owner_id || props.user.role === "Admin") &&
|
||||
<button onClick={() =>DeleteGameNight(g.id, g.owner)}>
|
||||
|
||||
Reference in New Issue
Block a user