Skip to content

Commit

Permalink
fix: per month amounts in handled view (HL-1046) (#2518)
Browse files Browse the repository at this point in the history
  • Loading branch information
mjturt authored Nov 23, 2023
1 parent 051469d commit 7a7f4ef
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,15 @@ const DoneModalContent: React.FC<ComponentProps> = ({
})}
</$Text>
</$GridCell>
{dateRangeRows.length === helsinkiBenefitMonthlyRows.length &&
dateRangeRows.map((row, index) => (
<$Text key={row.id}>
{t(`${translationsBase}.eurosPerMonth`, {
euros: formatFloatToCurrency(
helsinkiBenefitMonthlyRows[index].amount,
null,
'fi-FI',
0
),
dateRange: row.descriptionFi.toLocaleLowerCase(),
})}
</$Text>
))}
{helsinkiBenefitMonthlyRows.map((row, index) => (
<$Text key={row.id}>
{t(`${translationsBase}.eurosPerMonth`, {
euros: formatFloatToCurrency(row.amount, null, 'fi-FI', 0),
dateRange:
dateRangeRows[index]?.descriptionFi.toLocaleLowerCase(),
})}
</$Text>
))}
</$GridCell>
)}
{description && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,24 +54,19 @@ const HandledView: React.FC<ApplicationReviewViewProps> = ({ data }) => {
</$GridCell>
)}
{data.status === APPLICATION_STATUSES.ACCEPTED &&
dateRangeRows.length === helsinkiBenefitMonthlyRows.length &&
dateRangeRows.map((row, index) => (
helsinkiBenefitMonthlyRows.map((row, index) => (
<$HandledRow key={row.id}>
<$GridCell $colSpan={9} $colStart={1}>
<$ViewField large>
{t(`${translationsBase}.common.dateRange`, {
dateRange: row.descriptionFi.toLocaleLowerCase(),
dateRange:
dateRangeRows[index]?.descriptionFi.toLocaleLowerCase(),
})}
</$ViewField>
</$GridCell>
<$GridCell $colSpan={2}>
<$ViewFieldBold large>
{formatFloatToCurrency(
helsinkiBenefitMonthlyRows[index].amount,
'EUR',
'fi-FI',
0
)}
{formatFloatToCurrency(row.amount, 'EUR', 'fi-FI', 0)}
{t('common:utility.perMonth')}
</$ViewFieldBold>
</$GridCell>
Expand Down

0 comments on commit 7a7f4ef

Please sign in to comment.