fix(gh-6316): make links open in new tabs

- if a link is a) external, or b) embedded within a paragraph, make the link open in a new tab
This commit is contained in:
JoelGritter 2022-03-18 20:45:50 -04:00
parent d1b92fca65
commit 5973b914e4

View file

@ -17,7 +17,11 @@ const About = () => (
<p><FormattedMessage <p><FormattedMessage
id="about.introOne" id="about.introOne"
values={{foundationLink: ( values={{foundationLink: (
<a href="https://www.scratchfoundation.org/"> <a
href="https://www.scratchfoundation.org/"
rel="noreferrer noopener"
target="_blank"
>
<FormattedMessage id="about.foundationText" /> <FormattedMessage id="about.foundationText" />
</a> </a>
)}} )}}
@ -112,7 +116,11 @@ const About = () => (
id="about.quotesDescription" id="about.quotesDescription"
values={{ values={{
quotesLink: ( quotesLink: (
<a href="/info/quotes/"> <a
href="/info/quotes/"
rel="noreferrer noopener"
target="_blank"
>
<FormattedMessage id="about.quotesLinkText" /> <FormattedMessage id="about.quotesLinkText" />
</a> </a>
) )
@ -135,7 +143,11 @@ const About = () => (
</a> </a>
), ),
lifelongKindergartenGroupLink: ( lifelongKindergartenGroupLink: (
<a href="https://www.media.mit.edu/groups/lifelong-kindergarten/overview/"> <a
href="https://www.media.mit.edu/groups/lifelong-kindergarten/overview/"
rel="noreferrer noopener"
target="_blank"
>
<FormattedMessage id="about.lifelongKindergartenGroupLinkText" /> <FormattedMessage id="about.lifelongKindergartenGroupLinkText" />
</a> </a>
), ),
@ -158,12 +170,20 @@ const About = () => (
</a> </a>
), ),
statisticsLink: ( statisticsLink: (
<a href="/statistics"> <a
href="/statistics"
rel="noreferrer noopener"
target="_blank"
>
<FormattedMessage id="about.statisticsLinkText" /> <FormattedMessage id="about.statisticsLinkText" />
</a> </a>
), ),
annualReportLink: ( annualReportLink: (
<a href="/annual-report"> <a
href="/annual-report"
rel="noreferrer noopener"
target="_blank"
>
<FormattedMessage id="about.annualReportLinkText" /> <FormattedMessage id="about.annualReportLinkText" />
</a> </a>
) )
@ -214,7 +234,11 @@ const About = () => (
) )
}} }}
/></p> /></p>
<a href="//secure.donationpay.org/scratchfoundation/"> <a
href="//secure.donationpay.org/scratchfoundation/"
rel="noreferrer noopener"
target="_blank"
>
<Button className="about-button"> <Button className="about-button">
<FormattedMessage id="about.donateButton" /> <FormattedMessage id="about.donateButton" />
</Button> </Button>