From 5de7ab0daa255b608f008f454595c8f1cc66bcda Mon Sep 17 00:00:00 2001 From: Kristoffer Juelsen Date: Fri, 22 Apr 2022 09:21:53 +0200 Subject: [PATCH] Conditional rendering for countdown --- src/client/src/FrontPage.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/client/src/FrontPage.js b/src/client/src/FrontPage.js index 6519fce..b585e6c 100644 --- a/src/client/src/FrontPage.js +++ b/src/client/src/FrontPage.js @@ -78,7 +78,11 @@ function TournamentListItem(props) { ) } else { return( - Starts in: {remainingDays} Days, {remainingHours} Hours, {remainingMins} Minutes and {remainingSecs} Seconds + { remainingDays > 0 ? {remainingDays} days : null } + { remainingHours > 0 ? {remainingHours} hours : null } + { remainingMins > 0 ? {remainingMins} mins : null } + { remainingSecs > 0 ? {remainingSecs} secs : null } + {/* Starts in: {remainingDays} Days, {remainingHours} Hours, {remainingMins} Minutes and {remainingSecs} Seconds */} ) }