Skip to content

Commit

Permalink
Conditionally render email link
Browse files Browse the repository at this point in the history
  • Loading branch information
caleballdrin committed Sep 13, 2024
1 parent da3123a commit 2589754
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/components/Tool/FixSendNewsletter/Contact.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -213,17 +213,19 @@ const Contact = ({
{contact.primaryPerson?.firstName &&
contact.primaryPerson?.lastName && (
<Typography variant="subtitle1">
{`${contact.primaryPerson?.firstName} ${contact.primaryPerson?.lastName}`}
{`${contact.primaryPerson.firstName} ${contact.primaryPerson.lastName}`}
</Typography>
)}
<Link
underline="hover"
href={`mailto:${contact.primaryPerson?.primaryEmailAddress?.email}`}
>
<Typography variant="body2">
{contact.primaryPerson?.primaryEmailAddress?.email || ''}
</Typography>
</Link>
{contact.primaryPerson?.primaryEmailAddress?.email && (
<Link
underline="hover"
href={`mailto:${contact.primaryPerson.primaryEmailAddress.email}`}
>
<Typography variant="body2">
{contact.primaryPerson?.primaryEmailAddress.email}
</Typography>
</Link>
)}
{contact.primaryPerson?.optoutEnewsletter && (
<Typography variant="body2">
{t('opted out of newsletter')}
Expand Down

0 comments on commit 2589754

Please sign in to comment.