From a6307e665a675b70bd7e6146988c7974a1b6e50e Mon Sep 17 00:00:00 2001 From: Kyle Flynn Date: Sun, 29 Sep 2024 09:52:36 +0300 Subject: [PATCH] added coopertition field --- .../seasons/fgc_default/components/alliance-result.tsx | 7 +++++-- front-end/src/seasons/fgc-2024/match-detail-info.tsx | 10 ++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/front-end/src/apps/audience-display/displays/seasons/fgc_default/components/alliance-result.tsx b/front-end/src/apps/audience-display/displays/seasons/fgc_default/components/alliance-result.tsx index c501990..3f11e36 100644 --- a/front-end/src/apps/audience-display/displays/seasons/fgc_default/components/alliance-result.tsx +++ b/front-end/src/apps/audience-display/displays/seasons/fgc_default/components/alliance-result.tsx @@ -20,7 +20,7 @@ import { Grid } from '@mui/material'; import BreakdownRow from './breakdown-row'; import { Block } from '@mui/icons-material'; import { CardStatus } from '@toa-lib/models/build/seasons/FeedingTheFuture'; -import { useCurrentTournament } from 'src/api/use-tournament-data'; +import { useTournamentsForEvent } from 'src/api/use-tournament-data'; const Container = styled.div` display: flex; @@ -159,7 +159,7 @@ export const AllianceResult: FC = ({ ranks, teams }) => { - const tournament = useCurrentTournament(); + const { data: tournaments } = useTournamentsForEvent(match.eventKey); const participants = match.participants ?? []; const allianceParticipants = participants.filter((p) => alliance === 'red' ? p.station < BLUE_STATION : p.station >= BLUE_STATION @@ -168,6 +168,9 @@ export const AllianceResult: FC = ({ () => (teams ? Object.fromEntries(teams.map((t) => [t.teamKey, t])) : {}), [teams] ); + const tournament = tournaments?.find( + (teams) => teams.tournamentKey === match.tournamentKey + ); const isPlayoffs = tournament ? tournament.tournamentLevel > QUALIFICATION_LEVEL : false; diff --git a/front-end/src/seasons/fgc-2024/match-detail-info.tsx b/front-end/src/seasons/fgc-2024/match-detail-info.tsx index f58c08d..290fea8 100644 --- a/front-end/src/seasons/fgc-2024/match-detail-info.tsx +++ b/front-end/src/seasons/fgc-2024/match-detail-info.tsx @@ -222,6 +222,16 @@ export const MatchDetailInfo: FC< onChange={handleUpdates} /> + + + );