Skip to content

Commit

Permalink
Merge pull request #263 from ORNL-AMO/fix-surprises
Browse files Browse the repository at this point in the history
Use title and text of surprise
  • Loading branch information
nbintertech authored Mar 13, 2024
2 parents 52817bc + 577d483 commit 73e7b74
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/Projects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -666,8 +666,8 @@ Projects[Pages.compressedAirSystemImprovemnt] = new ProjectControl({
},
utilityRebateValue: 5000,
recapSurprises: [{
title: 'Uh oh - Replacing the compressors did not save as much electricity as estimated!',
text: 'Uh oh - Replacing the compressors did not save as much electricity as estimated! Only 2,000,000 kWh was saved.',
title: 'Uh oh - Replacing the compressors did not save as much electricity as estimated! ',
text: 'While replacing old compressors, you only saved 2,000,000 kWh instead of the estimated 2,250,000 kWh',
className: 'year-recap-negative-surprise',
avatar: {
icon: <BoltIcon />,
Expand Down
10 changes: 5 additions & 5 deletions src/components/YearRecap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ export class YearRecap extends React.Component<YearRecapProps, { inView }> {
projectRecapCards.push(
...project.recapSurprises.map((projectSurprise, index) => {
return (
this.getSurpriseEventCard(projectSurprise, project.title, project.shortTitle, index)
this.getSurpriseEventCard(projectSurprise, project.title, index)
);
})
);
Expand All @@ -799,8 +799,8 @@ export class YearRecap extends React.Component<YearRecapProps, { inView }> {
/**
* Add card for negative/positive surprises.
*/
getSurpriseEventCard(surprise: RecapSurprise, title: string, subHeader: string | undefined, index?: number): JSX.Element {
let keyId = index !== undefined ? index : title;
getSurpriseEventCard(surprise: RecapSurprise, projectTitle: string, index?: number): JSX.Element {
let keyId = index !== undefined ? index : projectTitle;
return <ListItem key={`year-recap-surprise_${keyId}`}>
<ThemeProvider theme={darkTheme}>
<Card className={surprise.className} sx={{ width: '100%' }}>
Expand All @@ -812,8 +812,8 @@ export class YearRecap extends React.Component<YearRecapProps, { inView }> {
{surprise.avatar.icon}
</Avatar>
}
title={title}
subheader={subHeader}
title={surprise.title}
subheader={projectTitle}
/>
<CardContent>
<Typography variant='body1' dangerouslySetInnerHTML={parseSpecialText(surprise.text)} />
Expand Down

0 comments on commit 73e7b74

Please sign in to comment.