Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adoptium.net 2215 translate the asciidoc contributors #2216

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/components/LinkText/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@ import React from 'react';
type LinkTextProps = {
href: string;
children?: React.ReactNode;
target?: string,
rel?: string
};

const LinkText = ({ href, children, target, rel }: LinkTextProps) => {
const LinkText = ({ href, children }: LinkTextProps) => {
return (
href.startsWith('http') ? <a href={href} target={target ? target : '_blank'} rel={rel ? rel : 'noreferrer'}>{children}</a> : <Link to={href}>{children}</Link>
href.startsWith('http') ? <a href={href} target='_blank' rel='noreferrer'>{children}</a> : <Link to={href}>{children}</Link>
)
}

Expand Down
8 changes: 4 additions & 4 deletions src/components/RandomContributor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useAdoptiumContributorsApi, useOnScreen } from '../../hooks';
import './RandomContributor.scss';
import AnimatedPlaceholder from '../AnimatedPlaceholder';
import { Trans } from 'gatsby-plugin-react-i18next';
import LinkText from '../LinkText'
import Link from '@mui/material/Link';
xavierfacq marked this conversation as resolved.
Show resolved Hide resolved

const RandomContributor = (): JSX.Element => {
const ref = useRef<HTMLDivElement | null>(null);
Expand Down Expand Up @@ -32,9 +32,9 @@ const RandomContributor = (): JSX.Element => {
i18nKey="asciidoc.random.contributor.text"
defaults='Thank you <profileUri>{{login}}</profileUri> for making <commitsListUri>{{contributionsCount}} contributions</commitsListUri> to <repoUri>{{repo}}</repoUri>'
components={{
profileUri: <LinkText href={contributor.profileUri} target="_blank" rel="nofollow noopener noreferrer"/>,
commitsListUri: <LinkText href={contributor.commitsListUri} target="_blank" rel="nofollow noopener noreferrer"/>,
repoUri: <LinkText href={`https://github.com/adoptium/${contributor.repo}`} target="_blank" rel="nofollow noopener noreferrer"/>,
profileUri: <Link href={contributor.profileUri} target="_blank" rel="nofollow noopener noreferrer" />,
commitsListUri: <Link href={contributor.commitsListUri} target="_blank" rel="nofollow noopener noreferrer"/>,
repoUri: <Link href={`https://github.com/adoptium/${contributor.repo}`} target="_blank" rel="nofollow noopener noreferrer"/>,
}}
values={{
'login': contributor.login,
Expand Down