From a62b245752158d97f874e694560b3e1b2845817e Mon Sep 17 00:00:00 2001 From: Felix Albrigtsen Date: Wed, 30 Mar 2022 00:25:34 +0200 Subject: [PATCH] Short description --- src/client/src/FrontPage.js | 9 ++++++++- src/client/src/TournamentManager.js | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/client/src/FrontPage.js b/src/client/src/FrontPage.js index ea75da8..f538dcd 100644 --- a/src/client/src/FrontPage.js +++ b/src/client/src/FrontPage.js @@ -25,6 +25,13 @@ function CreateButton(props) { ); } +function shorten(description, maxLength) { + if (description.length > maxLength) { + return description.substring(0, maxLength) + "..."; + } + return description; +} + function TournamentListItem(props) { return ( @@ -38,7 +45,7 @@ function TournamentListItem(props) { /> {props.tournament.name} - {props.tournament.description} + {shorten(props.tournament.description, 200)} Start: {props.tournament.startTime.toLocaleString()} End: {props.tournament.endTime.toLocaleString()} Players {props.tournament.teamCount} / {props.tournament.teamLimit} diff --git a/src/client/src/TournamentManager.js b/src/client/src/TournamentManager.js index e331ae9..3ed5e11 100644 --- a/src/client/src/TournamentManager.js +++ b/src/client/src/TournamentManager.js @@ -120,7 +120,7 @@ function ManageTournament(props) { {/* Edit name: */} {/* Edit description: */} - + {/*