From ab472c3875c48ae62353d3f04540c0260506388b Mon Sep 17 00:00:00 2001 From: Felix Albrigtsen Date: Wed, 30 Mar 2022 01:35:22 +0200 Subject: [PATCH] Slight collapse change --- src/client/src/FrontPage.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/client/src/FrontPage.js b/src/client/src/FrontPage.js index e642c3e..7690018 100644 --- a/src/client/src/FrontPage.js +++ b/src/client/src/FrontPage.js @@ -36,6 +36,7 @@ function shorten(description, maxLength) { function TournamentListItem(props) { const [longDescription, setLongDescription] = React.useState(false); + const maxLength = 200; function toggleDescription() { setLongDescription(!longDescription); } @@ -45,9 +46,11 @@ function TournamentListItem(props) { {props.tournament.description} ) + } else if (props.tournament.description.length < maxLength) { + return {props.tournament.description} } else { return - {shorten(props.tournament.description, 200)} + {shorten(props.tournament.description, maxLength)} ; }