-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NOREF] External link component (#676)
* add external link init * updated to use new external link component * updated to use new external link component * updated to use new external link component * update snaps * Add translations for the aria label
- Loading branch information
Showing
20 changed files
with
115 additions
and
252 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import React from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { Link } from '@trussworks/react-uswds'; | ||
|
||
interface ExternalLinkProps { | ||
children: React.ReactNode; | ||
className?: string; | ||
href: string; | ||
} | ||
|
||
const ExternalLink = ({ children, className, href }: ExternalLinkProps) => { | ||
const { t } = useTranslation('general'); | ||
|
||
return ( | ||
<Link | ||
href={href} | ||
aria-label={t('newTab')} | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
className={className} | ||
variant="external" | ||
> | ||
{children} | ||
</Link> | ||
); | ||
}; | ||
|
||
export default ExternalLink; |
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 |
---|---|---|
|
@@ -866,8 +866,11 @@ exports[`SixPagerMeeting matches the snapshot 1`] = ` | |
> | ||
Contact the MINT team at | ||
<a | ||
class="usa-link" | ||
aria-label="Open in a new tab" | ||
class="usa-link usa-link--external" | ||
href="mailto:[email protected]" | ||
rel="noopener noreferrer" | ||
target="_blank" | ||
> | ||
[email protected] | ||
</a> | ||
|
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 |
---|---|---|
|
@@ -548,8 +548,11 @@ exports[`TwoPagerMeeting matches the snapshot 1`] = ` | |
> | ||
Contact the MINT team at | ||
<a | ||
class="usa-link" | ||
aria-label="Open in a new tab" | ||
class="usa-link usa-link--external" | ||
href="mailto:[email protected]" | ||
rel="noopener noreferrer" | ||
target="_blank" | ||
> | ||
[email protected] | ||
</a> | ||
|
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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
import React from 'react'; | ||
import { Trans, useTranslation } from 'react-i18next'; | ||
import { | ||
Link, | ||
ProcessList, | ||
ProcessListHeading, | ||
ProcessListItem | ||
} from '@trussworks/react-uswds'; | ||
|
||
import ExternalLink from 'components/shared/ExternalLink'; | ||
import { HelpSolutionType } from 'views/HelpAndKnowledge/SolutionsHelp/solutionsMap'; | ||
|
||
import { TimelineConfigType } from '../Generic/timeline'; | ||
|
@@ -63,14 +63,9 @@ const Innovation4TimeLine = ({ solution }: { solution: HelpSolutionType }) => { | |
i18nKey={`solutions.${solution.key}.timeline.items[0].description`} | ||
> | ||
Send an email to{' '} | ||
<Link | ||
aria-label="Open in a new tab" | ||
href="mailto:[email protected]" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
<ExternalLink href="mailto:[email protected]"> | ||
[email protected] | ||
</Link>{' '} | ||
</ExternalLink>{' '} | ||
if interested in using 4i and ACO-OS for your model. Please also | ||
include Ashley Corbin and Nora Fleming on the email. | ||
</Trans> | ||
|
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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
import React from 'react'; | ||
import { Trans, useTranslation } from 'react-i18next'; | ||
import { | ||
Link, | ||
ProcessList, | ||
ProcessListHeading, | ||
ProcessListItem | ||
} from '@trussworks/react-uswds'; | ||
|
||
import ExternalLink from 'components/shared/ExternalLink'; | ||
import { HelpSolutionType } from 'views/HelpAndKnowledge/SolutionsHelp/solutionsMap'; | ||
|
||
import { TimelineConfigType } from '../Generic/timeline'; | ||
|
@@ -28,14 +28,9 @@ const CMSBoxTimeline = ({ solution }: { solution: HelpSolutionType }) => { | |
<Trans i18nKey={`solutions.${solution.key}.timeline.description`}> | ||
Since this is a self service tool, you can work at your own pace. If you | ||
have questions or need help using CMS Box, contact the MINT Team at{' '} | ||
<Link | ||
aria-label="Open in a new tab" | ||
href="mailto:[email protected]" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
<ExternalLink href="mailto:[email protected]"> | ||
[email protected] | ||
</Link> | ||
</ExternalLink> | ||
. | ||
</Trans> | ||
|
||
|
@@ -54,15 +49,9 @@ const CMSBoxTimeline = ({ solution }: { solution: HelpSolutionType }) => { | |
{timelineConfig.items[0].description} | ||
|
||
<p> | ||
<Link | ||
aria-label="Open in a new tab" | ||
href="https://cmsbox.account.box.com/login" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
variant="external" | ||
> | ||
<ExternalLink href="https://cmsbox.account.box.com/login"> | ||
{timelineConfig.links && timelineConfig.links[0]} | ||
</Link> | ||
</ExternalLink> | ||
</p> | ||
</ProcessListItem> | ||
|
||
|
@@ -80,15 +69,9 @@ const CMSBoxTimeline = ({ solution }: { solution: HelpSolutionType }) => { | |
{timelineConfig.items[1].description} | ||
|
||
<p> | ||
<Link | ||
aria-label="Open in a new tab" | ||
href="https://cmsintranet.share.cms.gov/CT/Pages/BoxInformation.aspx" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
variant="external" | ||
> | ||
<ExternalLink href="https://cmsintranet.share.cms.gov/CT/Pages/BoxInformation.aspx"> | ||
{timelineConfig.links && timelineConfig.links[1]} | ||
</Link> | ||
</ExternalLink> | ||
</p> | ||
</ProcessListItem> | ||
</ProcessList> | ||
|
Oops, something went wrong.