Gamenights also return their game list.

This commit is contained in:
2022-05-29 00:22:30 +02:00
parent 86cdbedd41
commit 2ba2026e21
7 changed files with 139 additions and 27 deletions

View 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

View File

@@ -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)}>