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..20259af1 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,12 @@ export const AudDisplayDefault: FC = ({ id }) => { ); } } + const afterMatchBeforeScore = + matchState > MatchState.MATCH_IN_PROGRESS && + matchState < MatchState.RESULTS_POSTED; + + const showPreviewFull = + layout[0] === LayoutMode.FULL || layout[1] === LayoutMode.FULL; return ( <> @@ -99,9 +115,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 && (