Skip to content

Commit

Permalink
feat(github-icon): Adding link to github repository (#145)
Browse files Browse the repository at this point in the history
Go to github repository when github icon is clicked. (Resolves #102)
  • Loading branch information
german-mergestat committed Aug 19, 2022
2 parents c0dc5ab + 629a52d commit 6f54035
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -6,6 +6,7 @@ import React from 'react'
import type { RepoType } from 'src/@types'
import RepoImage from 'src/components/RepoImage'
import { getRelativeTime } from 'src/utils'
import { GITHUB_URL } from 'src/utils/constants'

export type RepositoryNameProps = {
id: string
Expand All @@ -23,7 +24,11 @@ export const RepositoryName: React.FC<RepositoryNameProps> = (props) => {
case 'other':
return <RepositoryIcon className="t-icon text-semantic-mutedIcon w-4" />
default:
return <GithubIcon className="t-icon text-semantic-mutedIcon w-4" />
return (
<a target='_blank' href={GITHUB_URL + props.name} rel='noopener noreferrer'>
<GithubIcon className="t-icon text-semantic-mutedIcon w-4" />
</a>
)
}
}

Expand Down

0 comments on commit 6f54035

Please sign in to comment.