Skip to content

Commit

Permalink
feat(frontend): add details for parents, sin and contact information …
Browse files Browse the repository at this point in the history
…on review page (#314)

* add details for parents, sin and contact information on review page

* refactor(frontend): cleanup of `string-utils.ts`

* refactor(frontend): cleanup of `string-utils.ts`

* removed empty string check from other names on personnal detail

---------

Co-authored-by: Greg Baker <gregory.j.baker@hrsdc-rhdcc.gc.ca>
  • Loading branch information
faiza-jahanzeb and gregory-j-baker authored Mar 5, 2025
1 parent d2a1774 commit 394da40
Show file tree
Hide file tree
Showing 6 changed files with 722 additions and 192 deletions.
5 changes: 4 additions & 1 deletion frontend/app/.server/locales/protected-en.json
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,10 @@
"edit-secondary-identity-document": "Edit secondary identity document",
"edit-current-name": "Edit current name",
"edit-personal-details": "Edit personal details",
"edit-birth-details": "Edit birth details"
"edit-birth-details": "Edit birth details",
"edit-parent-details": "Edit parent details",
"edit-previous-sin": "Edit previous sin",
"edit-contact-information": "Edit contact information"
},
"search-sin": {
"page-title": "Search for a SIN",
Expand Down
5 changes: 4 additions & 1 deletion frontend/app/.server/locales/protected-fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,10 @@
"edit-secondary-identity-document": "Modifier le document d'identité secondaire",
"edit-current-name": "Modifier le nom actuel",
"edit-personal-details": "Modifier les détails personnels",
"edit-birth-details": "Modifier les détails de naissance"
"edit-birth-details": "Modifier les détails de naissance",
"edit-parent-details": "Modifier les détails des parents",
"edit-previous-sin": "Modifier les NAS précédent",
"edit-contact-information": "Modifier les informations de contact"
},
"search-sin": {
"page-title": "Search for a SIN",
Expand Down
32 changes: 32 additions & 0 deletions frontend/app/components/address.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import type { ComponentProps, JSX } from 'react';

import { formatAddress } from '~/utils/string-utils';
import { cn } from '~/utils/tailwind-utils';

type Address = {
addressLine1?: string;
addressLine2?: string;
city?: string;
postalZipCode?: string;
provinceState?: string;
country: string;
};

type AddressProps = ComponentProps<'address'> & {
address: Address;
/**
* The format of the address
*
* - `standard`: The standard address format, with the address line, city, province/state, postal/zip code, and country.
* - `alternative`: An alternative address format, with the address line, city, province/state, postal/zip code, and country on separate lines.
*/
format?: 'standard' | 'alternative';
};

export function Address({ address, format, className, ...rest }: AddressProps): JSX.Element {
return (
<address className={cn('whitespace-pre-wrap not-italic', className)} data-testid="address-id" {...rest}>
{formatAddress(address, format)}
</address>
);
}
Loading

0 comments on commit 394da40

Please sign in to comment.