From 1040b92eeeea45fe08ff6084d8c381f96b144f48 Mon Sep 17 00:00:00 2001 From: "Kalle (Sendou)" <38327916+Sendouc@users.noreply.github.com> Date: Tue, 28 Dec 2021 09:19:10 +0200 Subject: [PATCH] Bracket defeated team visual --- app/components/tournament/EliminationBracket.tsx | 14 ++++++++++++-- app/core/tournament/utils.ts | 11 +++++++++++ app/styles/tournament-bracket.css | 4 ++++ 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/app/components/tournament/EliminationBracket.tsx b/app/components/tournament/EliminationBracket.tsx index 4e0bb2ade..47f3dbeca 100644 --- a/app/components/tournament/EliminationBracket.tsx +++ b/app/components/tournament/EliminationBracket.tsx @@ -1,5 +1,6 @@ import classNames from "classnames"; import invariant from "tiny-invariant"; +import { matchIsOver } from "~/core/tournament/utils"; import type { BracketModified } from "~/services/tournament"; import { MyCSSProperties, Unpacked } from "~/utils"; @@ -92,6 +93,7 @@ export function EliminationBracket({ key={match.id} match={match} ownTeamName={ownTeamName} + isOver={matchIsOver(round.bestOf, match.score)} /> ); })} @@ -140,10 +142,12 @@ export function Match({ match, hidden, ownTeamName, + isOver, }: { match: Unpacked["matches"]>; hidden?: boolean; ownTeamName?: string; + isOver: boolean; }) { return (