From 21d7703c679c85929abea1ac01ef22a83ebf4404 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Thu, 11 Mar 2021 16:15:38 +0100 Subject: readme update + recent games empty case --- components/recentGames.tsx | 50 +++++++++++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 21 deletions(-) (limited to 'components') diff --git a/components/recentGames.tsx b/components/recentGames.tsx index 92855a1..a37f662 100644 --- a/components/recentGames.tsx +++ b/components/recentGames.tsx @@ -41,27 +41,35 @@ function GameOutcome(props: { game: gameInfo }) { export default function RecentGames(props: { games?: Array }) { return

Recente partijen

- - - - - - - - - { - props.games?.map(game => - - - - - ) - } - -
TegenstanderUitkomstZettenDatum
{game.opponent?.username}{Math.max(0, game.moves.length -1)}{(() => { - var timeCreated = new Date(game.created); - return friendlyTime(timeCreated); - })()}
+ { + props.games?.length > 0 ? + + + + + + + + + { + props.games?.map(game => + + + + + ) + } + +
TegenstanderUitkomstZettenDatum
{game.opponent?.username}{Math.max(0, game.moves.length -1)}{(() => { + var timeCreated = new Date(game.created); + return friendlyTime(timeCreated); + })()}
: +

Deze gebruiker heeft nog geen partijen gespeeld

+ }
} -- cgit v1.2.3