From 4cb4da0f4402c283ba8a048e8588d41a7819eea1 Mon Sep 17 00:00:00 2001 From: Caleb Date: Tue, 5 Dec 2023 11:37:56 -0700 Subject: [PATCH] add branded results header --- src/Components/Referrer/Referrer.tsx | 39 ++++++++++++++++++++++++++++ src/Components/Results/Results.tsx | 20 +++++--------- 2 files changed, 45 insertions(+), 14 deletions(-) diff --git a/src/Components/Referrer/Referrer.tsx b/src/Components/Referrer/Referrer.tsx index 429af11f6..6d56655dc 100644 --- a/src/Components/Referrer/Referrer.tsx +++ b/src/Components/Referrer/Referrer.tsx @@ -3,6 +3,7 @@ import { Context } from '../Wrapper/Wrapper'; import Header from '../Header/Header'; import TwoOneOneFooter from '../TwoOneOneComponents/TwoOneOneFooter/TwoOneOneFooter'; import TwoOneOneHeader from '../TwoOneOneComponents/TwoOneOneHeader/TwoOneOneHeader'; +import { FormattedMessage } from 'react-intl'; type HeaderProps = { handleTextFieldChange: (event: Event) => void; @@ -25,3 +26,41 @@ export const BrandedFooter = () => { } return <>; }; + +type ResultsHeaderProps = { + programCount: number; + programsValue: number; + taxCreditsValue: number; +}; + +export const BrandedResultsHeader = ({ programsValue, taxCreditsValue, programCount }: ResultsHeaderProps) => { + const { formData } = useContext(Context); + + if (formData.immutableReferrer === 'lgs') { + return ( +

+ {programCount} + + ${Math.round(programsValue / 12).toLocaleString()} + +

+ ); + } + + return ( +

+ {programCount} + $ + {Math.round(programsValue / 12).toLocaleString()} + + ${Math.round(taxCreditsValue).toLocaleString()} + +

+ ); +}; diff --git a/src/Components/Results/Results.tsx b/src/Components/Results/Results.tsx index 7800e590a..01f6fdb0a 100644 --- a/src/Components/Results/Results.tsx +++ b/src/Components/Results/Results.tsx @@ -51,6 +51,7 @@ import { import { citizenshipFilterOperators } from '../FilterSection/CitizenshipPopover.tsx'; import type { CitizenLabels } from '../../Assets/citizenshipFilterFormControlLabels'; import EmailResults from '../EmailResults/EmailResults.tsx'; +import { BrandedResultsHeader } from '../Referrer/Referrer.tsx'; export type UpdateFilterArg = | { @@ -414,20 +415,11 @@ const Results = ({ handleTextFieldChange }: ResultsProps) => { } else { return ( -

- {citizenshipRowCount} - - ${Math.round(totalCitizenshipDollarValue.cashOrReducedExpenses / 12).toLocaleString()} - - ${Math.round(totalCitizenshipDollarValue.taxCredits).toLocaleString()} - -

+
); }