Change winner after tournament end

This commit is contained in:
Felix Albrigtsen 2022-04-25 14:17:27 +02:00
parent 60c6c6530a
commit 4786bfbd59
1 changed files with 2 additions and 2 deletions

View File

@ -155,7 +155,7 @@ function WinnerDisplay(props) {
return (
<div className="winnerDisplay winner">
<Typography variant="h4" component="h2" align="center">
{props.user.isLoggedIn && <IconButton color="error" aria-label="remove winner" component="span" onClick={unsetWinner}><BackspaceIcon /></IconButton>}
{props.user.isLoggedIn && !props.tournament.hasEnded && <IconButton color="error" aria-label="remove winner" component="span" onClick={unsetWinner}><BackspaceIcon /></IconButton>}
Winner:
</Typography>
<Typography variant="h4" component="h2">
@ -233,7 +233,7 @@ function BracketViewer(props){
return <TournamentTier user={props.user} tournament={props.tournament} key={tierNum} tier={tierNum} matches={tierMatches} teams={teams} onwinnerchange={getMatches} />
})}
<WinnerDisplay team={getWinnerTeam(matches)} user={props.user} finalMatch={getFinalMatch(matches)} onwinnerchange={getMatches} />
<WinnerDisplay team={getWinnerTeam(matches)} user={props.user} finalMatch={getFinalMatch(matches)} onwinnerchange={getMatches} tournament={props.tournament} />
</div>
</>
: <Box sx={{display:'flex', justifyContent:'center', alignItems:'center', position:'relative', marginTop:'5%'}}><CircularProgress size={"20vw"}/></Box>