Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
COR-949 Add vaccination campaign name localization (#4334)
Browse files Browse the repository at this point in the history
Co-authored-by: VWSCoronaDashboard21 <[email protected]>
  • Loading branch information
2 people authored and hasan-ozaynaci committed Jul 26, 2022
1 parent 68bb247 commit 8329b0b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import css from '@styled-system/css';
import { useRouter } from 'next/router';
import { useCollapsible } from '~/utils/use-collapsible';
import { useIntl } from '~/intl';
import { Cell, HeaderCell, Row, StyledTable } from '.';
Expand Down Expand Up @@ -62,6 +63,7 @@ const VaccineCampaignRow = ({
const { formatNumber } = useIntl();
const collapsible = useCollapsible({ isOpen: isFirst });
const isOpen = collapsible.isOpen;
const { locale = 'nl' } = useRouter();

return (
<Row isLast={isLast} isOpen={isOpen} onClick={() => collapsible.toggle()}>
Expand All @@ -70,7 +72,11 @@ const VaccineCampaignRow = ({
<tbody>
<tr>
<Cell css={css({ pt: 3 })} mobile>
<strong>{campaign.vaccine_campaign_name_nl}</strong>
<strong>
{locale === 'nl'
? campaign.vaccine_campaign_name_nl
: campaign.vaccine_campaign_name_en}
</strong>
</Cell>

<Cell css={css({ pt: 3 })} alignRight mobile>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import css from '@styled-system/css';
import { useRouter } from 'next/router';
import { useCollapsible } from '~/utils/use-collapsible';
import { useIntl } from '~/intl';
import { Cell, HeaderCell, Row, StyledTable } from '.';
Expand Down Expand Up @@ -62,15 +63,20 @@ const VaccineCampaignRow = ({
const { formatNumber } = useIntl();
const collapsible = useCollapsible({ isOpen: isFirst });
const isOpen = collapsible.isOpen;
const { locale = 'nl' } = useRouter();

return (
<Row isLast={isLast} isOpen={isOpen} onClick={() => collapsible.toggle()}>
<Cell colSpan={4} css={css({ p: 0 })}>
<StyledTable>
<tbody>
<tr>
<Cell css={css({ fontWeight: 'bold' })}>
{campaign.vaccine_campaign_name_nl}
<Cell>
<strong>
{locale === 'nl'
? campaign.vaccine_campaign_name_nl
: campaign.vaccine_campaign_name_en}
</strong>
</Cell>

<Cell>
Expand Down

0 comments on commit 8329b0b

Please sign in to comment.