Skip to content

Commit

Permalink
Fix/issue 2252 broken link when translated (#2254)
Browse files Browse the repository at this point in the history
* [fix-2252] fix broken links when display a translated version

* Pb occured in this file too

* Use LinkText for external links
  • Loading branch information
xavierfacq authored Sep 25, 2023
1 parent 2d25086 commit f5623fa
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
9 changes: 5 additions & 4 deletions src/components/RandomContributor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import React, { MutableRefObject, useRef } from 'react';
import { useAdoptiumContributorsApi, useOnScreen } from '../../hooks';
import './RandomContributor.scss';
import AnimatedPlaceholder from '../AnimatedPlaceholder';
import { Trans, Link } from 'gatsby-plugin-react-i18next';
import { Trans } from 'gatsby-plugin-react-i18next';
import LinkText from '../LinkText'

const RandomContributor = (): JSX.Element => {
const ref = useRef<HTMLDivElement | null>(null);
Expand Down Expand Up @@ -31,9 +32,9 @@ const RandomContributor = (): JSX.Element => {
i18nKey="asciidoc.random.contributor.text"
defaults='Thank you <profileUri>{{login}}</profileUri> for making <commitsListUri>{{contributionsCount}} contribution(s)</commitsListUri> to <repoUri>{{repo}}</repoUri>'
components={{
profileUri: <Link to={contributor.profileUri} target="_blank" rel="nofollow noopener noreferrer" />,
commitsListUri: <Link to={contributor.commitsListUri} target="_blank" rel="nofollow noopener noreferrer"/>,
repoUri: <Link to={`https://github.com/adoptium/${contributor.repo}`} target="_blank" rel="nofollow noopener noreferrer"/>,
profileUri: <LinkText href={contributor.profileUri} />,
commitsListUri: <LinkText href={contributor.commitsListUri} />,
repoUri: <LinkText href={`https://github.com/adoptium/${contributor.repo}`} />,
}}
values={{
'login': contributor.login,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ exports[`TemurinDownloadTable component > renders correctly - with source 1`] =
</a>
<a
href="https://mock-link"
rel="noreferrer"
target="_blank"
>
<svg
fill="currentColor"
Expand Down
5 changes: 3 additions & 2 deletions src/components/TemurinDownloadTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { capitalize } from '../../util/capitalize';
import { localeDate } from '../../util/localeDate';
import { IoMdHelpBuoy } from 'react-icons/io';
import { PiFiles } from 'react-icons/pi';
import LinkText from '../LinkText'

const TemurinDownloadTable = ({results}) => {
const { language } = useI18next();
Expand All @@ -21,8 +22,8 @@ const TemurinDownloadTable = ({results}) => {
{source &&
<p className='release-notes'>
<Link to={`/temurin/release-notes?version=${source.release_name}`}><MdNotes /><Trans>Release Notes</Trans></Link>
<Link to="/installation/"><IoMdHelpBuoy /><Trans>Installation Guide</Trans></Link>
<Link to={source.binary.package.link}><PiFiles /><Trans>Source Code</Trans></Link>
<Link to="/installation/"><IoMdHelpBuoy /><Trans>Installation Guide</Trans></Link>
<LinkText href={source.binary.package.link}><PiFiles /><Trans>Source Code</Trans></LinkText>
</p>
}
<table id="download-table" className="table table-bordered releases-table" style={{borderSpacing: '0 10px', borderCollapse: 'separate'}}>
Expand Down

0 comments on commit f5623fa

Please sign in to comment.