Skip to content

Commit

Permalink
Merge pull request #643 from Gary-Community-Ventures/refactor/prescho…
Browse files Browse the repository at this point in the history
…ol_category

Rename Child Care Youth and Education Category
  • Loading branch information
ivonne-hernandez authored Oct 10, 2023
2 parents 23e9db5 + 5d2c353 commit 52f6331
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions src/Components/Results/Results.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ const Results = () => {
});
};

const preschoolProgramCategory = 'Cuidado de Niños, Preescolar y Jóvenes';
const preschoolProgramCategory = 'Child Care, Youth, and Education';
const categoryValues = (programs: Program[]) => {
const preschoolPrograms = [0, 0];
const categoryValues: { [key: string]: number } = {};
Expand Down Expand Up @@ -608,6 +608,14 @@ const Results = () => {
);
};

const currentCategory = categories.find((cat) => {
if (filt.category === false) {
return false;
}

return cat.defaultMessage === filt.category.value;
});

return (
<>
<div className="filters-container">
Expand All @@ -622,17 +630,19 @@ const Results = () => {
/>
}
</div>
{filt.category !== false && (
{currentCategory && (
<>
<Toolbar sx={{ border: 1, backgroundColor: theme.primaryColor, color: 'white' }}>
<span className="space-around border-right">{filt.category.value}</span>
<span className="space-around border-right">
<FormattedMessage id={currentCategory.label} defaultMessage={currentCategory.defaultMessage} />
</span>
<span className="space-around">
${totalDollarAmount(programs, filt.category.value).toLocaleString()}{' '}
${totalDollarAmount(programs, currentCategory.defaultMessage).toLocaleString()}{' '}
<FormattedMessage id="results.perYear" defaultMessage="Per Year" />
</span>
</Toolbar>
{filt.category.value ===
categories.find((cat) => cat.label === preschoolProgramCategory)?.defaultMessage && (
{currentCategory.defaultMessage ===
categories.find((cat) => cat.defaultMessage === preschoolProgramCategory)?.defaultMessage && (
<Typography variant="body2" className="child-care-helper-text">
<FormattedMessage
id="benefitCategories.childCareHelperText"
Expand Down

0 comments on commit 52f6331

Please sign in to comment.