Short description

This commit is contained in:
Felix Albrigtsen 2022-03-30 00:25:34 +02:00
parent 2a3abb9bf3
commit a62b245752
2 changed files with 9 additions and 2 deletions

View File

@ -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) { function TournamentListItem(props) {
return ( return (
<Paper elevation={8} > <Paper elevation={8} >
@ -38,7 +45,7 @@ function TournamentListItem(props) {
/> />
<CardContent align="left"> <CardContent align="left">
<Typography variant="h3" component="div" align="center">{props.tournament.name} </Typography> <Typography variant="h3" component="div" align="center">{props.tournament.name} </Typography>
<Typography variant="h5" color="text.primary">{props.tournament.description}</Typography> <Typography variant="h5" color="text.primary">{shorten(props.tournament.description, 200)}</Typography>
<Typography variant="body2" color="text.secondary"> Start: {props.tournament.startTime.toLocaleString()} </Typography> <Typography variant="body2" color="text.secondary"> Start: {props.tournament.startTime.toLocaleString()} </Typography>
<Typography variant="body2" color="text.secondary"> End: {props.tournament.endTime.toLocaleString()} </Typography> <Typography variant="body2" color="text.secondary"> End: {props.tournament.endTime.toLocaleString()} </Typography>
<Typography variant="h5" color="text.primary" gutterBottom> Players {props.tournament.teamCount} / {props.tournament.teamLimit} </Typography> <Typography variant="h5" color="text.primary" gutterBottom> Players {props.tournament.teamCount} / {props.tournament.teamLimit} </Typography>

View File

@ -120,7 +120,7 @@ function ManageTournament(props) {
{/* <InputLabel htmlFor="editName">Edit name: </InputLabel> */} {/* <InputLabel htmlFor="editName">Edit name: </InputLabel> */}
<TextField type="text" id="editName" label="Edit Name:" placeholder="Edit Name" InputLabelProps={{shrink: true}}/> <TextField type="text" id="editName" label="Edit Name:" placeholder="Edit Name" InputLabelProps={{shrink: true}}/>
{/* <InputLabel htmlFor="editDesc">Edit description: </InputLabel> */} {/* <InputLabel htmlFor="editDesc">Edit description: </InputLabel> */}
<TextField type="text" id="editDesc" label="Edit Description:" placeholder="Edit Description" InputLabelProps={{shrink: true}} /> <TextField type="text" multiline={true} id="editDesc" label="Edit Description:" placeholder="Edit Description" InputLabelProps={{shrink: true}} />
{/* <Box sx={{ flexGrow: 1 }}> {/* <Box sx={{ flexGrow: 1 }}>
<Grid container spacing={-20} justifyContent="center"> <Grid container spacing={-20} justifyContent="center">