From 9006e5dbf03d5da77d88b26a6a88fdfab264435d Mon Sep 17 00:00:00 2001 From: Soren Zaiser Date: Wed, 25 Sep 2024 11:24:03 -0400 Subject: [PATCH 1/2] Hide audience displays after match --- .../audience-display/displays/ad-default.tsx | 32 +++++++++++++++---- 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/front-end/src/apps/audience-display/displays/ad-default.tsx b/front-end/src/apps/audience-display/displays/ad-default.tsx index eba2dc4b..67e34892 100644 --- a/front-end/src/apps/audience-display/displays/ad-default.tsx +++ b/front-end/src/apps/audience-display/displays/ad-default.tsx @@ -1,9 +1,18 @@ import { FC } from 'react'; import { DisplayModeProps } from 'src/apps/audience-display/displays'; import { useRecoilValue } from 'recoil'; -import { matchOccurringAtom, matchOccurringRanksAtom } from 'src/stores/recoil'; +import { + matchOccurringAtom, + matchOccurringRanksAtom, + matchStateAtom +} from 'src/stores/recoil'; import { useEvent } from 'src/api/use-event-data'; -import { AudienceScreens, Displays, LayoutMode } from '@toa-lib/models'; +import { + AudienceScreens, + Displays, + LayoutMode, + MatchState +} from '@toa-lib/models'; import { getDisplays } from './displays'; import { FadeInOut, @@ -20,6 +29,7 @@ import { useTeamsForEvent } from 'src/api/use-team-data'; export const AudDisplayDefault: FC = ({ id }) => { const match = useRecoilValue(matchOccurringAtom); const ranks = useRecoilValue(matchOccurringRanksAtom); + const matchState = useRecoilValue(matchStateAtom); const [searchParams] = useSearchParams(); const { data: teams } = useTeamsForEvent(match?.eventKey); @@ -92,6 +102,10 @@ export const AudDisplayDefault: FC = ({ id }) => { ); } } + const afterMatch = matchState > MatchState.MATCH_IN_PROGRESS; + + const showPreviewFull = + layout[0] === LayoutMode.FULL || layout[1] === LayoutMode.FULL; return ( <> @@ -99,9 +113,12 @@ export const AudDisplayDefault: FC = ({ id }) => { {id === Displays.BLANK && <>} {/* Displays.MATCH_PREVIEW */} - {layout[0] === LayoutMode.FULL && ( + {showPreviewFull && ( - + = ({ id }) => { {/* Displays.MATCH_START */} {layout[1] === LayoutMode.FULL && ( - + = ({ id }) => { {layout[1] === LayoutMode.STREAM && ( From c6b018600dbb8af57e809c939136ad8d13974ad2 Mon Sep 17 00:00:00 2001 From: Soren Zaiser Date: Wed, 25 Sep 2024 13:16:09 -0400 Subject: [PATCH 2/2] small update --- .../src/apps/audience-display/displays/ad-default.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/front-end/src/apps/audience-display/displays/ad-default.tsx b/front-end/src/apps/audience-display/displays/ad-default.tsx index 67e34892..20259af1 100644 --- a/front-end/src/apps/audience-display/displays/ad-default.tsx +++ b/front-end/src/apps/audience-display/displays/ad-default.tsx @@ -102,7 +102,9 @@ export const AudDisplayDefault: FC = ({ id }) => { ); } } - const afterMatch = matchState > MatchState.MATCH_IN_PROGRESS; + const afterMatchBeforeScore = + matchState > MatchState.MATCH_IN_PROGRESS && + matchState < MatchState.RESULTS_POSTED; const showPreviewFull = layout[0] === LayoutMode.FULL || layout[1] === LayoutMode.FULL; @@ -116,7 +118,7 @@ export const AudDisplayDefault: FC = ({ id }) => { {showPreviewFull && ( = ({ id }) => { {layout[1] === LayoutMode.FULL && ( = ({ id }) => { {layout[1] === LayoutMode.STREAM && (