Skip to content

Commit

Permalink
Merge pull request #799 from DTS-STN/stefan/3-0-1-changes
Browse files Browse the repository at this point in the history
Latest business requests for text removal, and expandable Canada/US s…
  • Loading branch information
stefan-oconnell authored Dec 9, 2024
2 parents c1f26bd + 418e346 commit bb83105
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 76 deletions.
4 changes: 2 additions & 2 deletions public/locales/en/status.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"error": {
"required": "The reference number is required."
},
"help-message": "If you can't find the file number or reference number, you can <Link>request to receive it</Link>.",
"help-message": "If you can't find the reference number, you can <Link>request to receive it</Link>.",
"label": "Reference number"
},
"given-name": {
Expand Down Expand Up @@ -80,7 +80,7 @@
"delivery-not-available": "If delivery is not available, an agent will reach out to you to coordinate delivery.",
"header": "Your passport has been printed and mailed",
"mailing": "We're mailing it to you",
"remote-area": "If you live in a northern or remote area, it may take up to 8 business days to arrive.",
"remote-area": "If you live in a northern or remote area, it may take up to 8 business days.",
"supporting-documents": "We may send your supporting documents back separately.",
"take-up-to": "It can take up to 2 to 3 business days to arrive."
},
Expand Down
2 changes: 1 addition & 1 deletion public/locales/fr/status.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"error": {
"required": "Le numéro de référence est obligatoire."
},
"help-message": "Si vous ne pouvez pas trouver le numéro de dossier ou le numéro de référence, <Link>vous pouvez demander à le recevoir</Link>.",
"help-message": "Si vous ne pouvez pas trouver le numéro de référence, <Link>vous pouvez demander à le recevoir</Link>.",
"label": "Numéro de référence"
},
"given-name": {
Expand Down
9 changes: 6 additions & 3 deletions src/components/Collapse.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { useId } from 'react'

const variants = {
fitWidth: 'w-fit',
fullWidth: 'w-full',
halfWidth: 'w-6/12',
slim: 'text-base',
default: '',
default: 'max-w-prose',
}
export interface CollapseProps {
title: string
Expand All @@ -15,12 +18,12 @@ const Collapse = ({ title, children, variant = 'default' }: CollapseProps) => {
return (
<details
aria-describedby={`${id}-details-summary`}
className={`mb-3 max-w-prose rounded border p-3 ${variants[variant]}`}
className={`mb-3 rounded border p-3 ${variants[variant]}`}
>
<summary
id={`${id}-details-summary`}
className={
'cursor-pointer text-blue-light hover:text-link-selected hover:underline focus:text-link-selected focus:underline '
'cursor-pointer text-blue-light hover:text-link-selected hover:underline focus:text-link-selected focus:underline'
}
>
{title}
Expand Down
151 changes: 81 additions & 70 deletions src/components/check-status-responses/CheckStatusShippingFedex.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Trans, useTranslation } from 'next-i18next'

import AlertBlock from '../AlertBlock'
import AlertSection from '../AlertSection'
import Collapse from '../Collapse'
import ExternalLink from '../ExternalLink'

export interface CheckStatusShippingFedexProps {
Expand All @@ -24,76 +25,86 @@ export const CheckStatusShippingFedex = ({
{t('shipped-fedex.header')}
</h1>
<p>{t('shipped-fedex.header')}.</p>
<h2 className="h2">{t('shipped-fedex.country-canada.header')}</h2>
<AlertSection type="success">
<h3 data-testid="shipped-purolator-mailing" className="h2 mt-0">
{t('shipped-fedex.country-canada.mailing')}
</h3>
{trackingNumber ? (
<>
<p>
<Trans
i18nKey="status-check-tracking.number"
ns="status"
tOptions={{ trackingNumber }}
/>
</p>
<p>
<Trans
i18nKey={'status-check-tracking.can-track'}
ns="status"
components={{
Link: (
<ExternalLink
data-gc-analytics-exempt={true}
href={t('status-check-tracking.link.purolator', {
trackingNumber: encodeURIComponent(trackingNumber),
})}
/>
),
}}
/>
</p>
</>
) : (
<p>{t('shipped-fedex.take-up-to')}</p>
)}
</AlertSection>
<h2 className="h2">{t('shipped-fedex.country-us.header')}</h2>
<AlertSection type="success">
<h3 data-testid="shipped-fedex-mailing" className="h2 mt-0">
{t('shipped-fedex.country-us.mailing')}
</h3>
{trackingNumber ? (
<>
<p>
<Trans
i18nKey="status-check-tracking.number"
ns="status"
tOptions={{ trackingNumber }}
/>
</p>
<p>
<Trans
i18nKey={'status-check-tracking.can-track'}
ns="status"
components={{
Link: (
<ExternalLink
data-gc-analytics-exempt={true}
href={t('status-check-tracking.link.fedex', {
trackingNumber: encodeURIComponent(trackingNumber),
})}
/>
),
}}
/>
</p>
</>
) : (
<p>{t('shipped-fedex.take-up-to')}</p>
)}
</AlertSection>
<div className="w-fit">
<Collapse
title={t('shipped-fedex.country-canada.header')}
variant="fullWidth"
>
<AlertSection className="mt-5" type="success">
<h2 data-testid="shipped-purolator-mailing" className="h2 mt-0">
{t('shipped-fedex.country-canada.mailing')}
</h2>
{trackingNumber ? (
<>
<p>
<Trans
i18nKey="status-check-tracking.number"
ns="status"
tOptions={{ trackingNumber }}
/>
</p>
<p>
<Trans
i18nKey={'status-check-tracking.can-track'}
ns="status"
components={{
Link: (
<ExternalLink
data-gc-analytics-exempt={true}
href={t('status-check-tracking.link.purolator', {
trackingNumber: encodeURIComponent(trackingNumber),
})}
/>
),
}}
/>
</p>
</>
) : (
<p>{t('shipped-fedex.take-up-to')}</p>
)}
</AlertSection>
</Collapse>
<Collapse
title={t('shipped-fedex.country-us.header')}
variant="fullWidth"
>
<AlertSection className="mt-5" type="success">
<h2 data-testid="shipped-fedex-mailing" className="h2 mt-0">
{t('shipped-fedex.country-us.mailing')}
</h2>
{trackingNumber ? (
<>
<p>
<Trans
i18nKey="status-check-tracking.number"
ns="status"
tOptions={{ trackingNumber }}
/>
</p>
<p>
<Trans
i18nKey={'status-check-tracking.can-track'}
ns="status"
components={{
Link: (
<ExternalLink
data-gc-analytics-exempt={true}
href={t('status-check-tracking.link.fedex', {
trackingNumber: encodeURIComponent(trackingNumber),
})}
/>
),
}}
/>
</p>
</>
) : (
<p>{t('shipped-fedex.take-up-to')}</p>
)}
</AlertSection>
</Collapse>
</div>
<p className="h3 mb-2 mt-6">
<strong>{t('shipped-fedex.supporting-documents')}</strong>
</p>
Expand Down

0 comments on commit bb83105

Please sign in to comment.