From b2d3f322ec25783d08efe8420e2b1a6cc6fe7d3b Mon Sep 17 00:00:00 2001 From: Felix Albrigtsen Date: Wed, 30 Mar 2022 00:47:38 +0200 Subject: [PATCH] Collapse buttons for description --- src/client/src/FrontPage.js | 20 ++++++++++++++++++-- src/client/src/TournamentCreator.js | 10 ++++------ 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/client/src/FrontPage.js b/src/client/src/FrontPage.js index a45cbe4..f663b53 100644 --- a/src/client/src/FrontPage.js +++ b/src/client/src/FrontPage.js @@ -7,8 +7,10 @@ import TournamentAnnouncement from "./TournamentAnnouncement"; import TournamentMatches from "./TournamentMatches"; import TournamentTeams from "./TournamentTeams"; import AppBar from './components/Appbar'; -import { Button, Container, Typography, Box, Stack, Card, CardContent, CardMedia, Paper, Grid } from "@mui/material"; +import { Button, Container, Typography, Box, Stack, Card, CardContent, CardMedia, Paper, Grid, Icon } from "@mui/material"; import AddCircleIcon from '@mui/icons-material/AddCircle'; +import KeyboardDoubleArrowDownIcon from '@mui/icons-material/KeyboardDoubleArrowDown'; +import KeyboardDoubleArrowUpIcon from '@mui/icons-material/KeyboardDoubleArrowUp'; function CreateButton(props) { return ( @@ -37,6 +39,19 @@ function TournamentListItem(props) { function toggleDescription() { setLongDescription(!longDescription); } + function Description() { + if (longDescription) { + return( + {props.tournament.description} + + ) + } else { + return + {shorten(props.tournament.description, 200)} + + ; + } + } return ( @@ -52,7 +67,8 @@ function TournamentListItem(props) { Start: {props.tournament.startTime.toLocaleString()} End: {props.tournament.endTime.toLocaleString()} Players {props.tournament.teamCount} / {props.tournament.teamLimit} - {longDescription ? props.tournament.description : shorten(props.tournament.description, 200)} + + {/* {longDescription ? props.tournament.description : (shorten(props.tournament.description, 200))} */} diff --git a/src/client/src/TournamentCreator.js b/src/client/src/TournamentCreator.js index ebc9647..e90a97c 100644 --- a/src/client/src/TournamentCreator.js +++ b/src/client/src/TournamentCreator.js @@ -124,12 +124,10 @@ function TournamentForm(props) { */} - {/* Start Time: */} - - - {/* End Time: */} - - + + + + Maximum number of teams