-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(frontend): add details for parents, sin and contact information …
…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
1 parent
d2a1774
commit 394da40
Showing
6 changed files
with
722 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
); | ||
} |
Oops, something went wrong.