diff options
author | 2023-09-20 13:01:47 +0800 | |
---|---|---|
committer | 2023-09-20 13:01:47 +0800 | |
commit | 64d867e730ba413cb0e0cc3a577a26c11cb3b01d (patch) | |
tree | 837cbf29e2b38928f6cf9daf017670b9f4cee7da /source/features/repo-header-info.tsx | |
parent | f9f6a0c70d1d3af559de9d189764abd7a43bf90d (diff) | |
download | refined-github-64d867e730ba413cb0e0cc3a577a26c11cb3b01d.tar.gz refined-github-64d867e730ba413cb0e0cc3a577a26c11cb3b01d.tar.zst refined-github-64d867e730ba413cb0e0cc3a577a26c11cb3b01d.zip |
`repo-header-info` - Add link and tooltip (#6932)
Diffstat (limited to '')
-rw-r--r-- | source/features/repo-header-info.tsx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/source/features/repo-header-info.tsx b/source/features/repo-header-info.tsx index f7df7527..20e862f9 100644 --- a/source/features/repo-header-info.tsx +++ b/source/features/repo-header-info.tsx @@ -8,7 +8,7 @@ import observe from '../helpers/selector-observer.js'; import features from '../feature-manager.js'; import api from '../github-helpers/api.js'; import GetRepositoryInfo from './repo-header-info.gql'; -import {cacheByRepo} from '../github-helpers/index.js'; +import {buildRepoURL, cacheByRepo} from '../github-helpers/index.js'; import abbreviateNumber from '../helpers/abbreviate-number.js'; type RepositoryInfo = { @@ -44,12 +44,16 @@ async function add(repoLink: HTMLAnchorElement): Promise<void> { ); } - if (stargazerCount) { + if (stargazerCount > 1) { repoLink.after( - <div className="d-flex flex-items-center flex-justify-center mr-1 gap-1"> + <a + href={buildRepoURL('stargazers')} + title={`Repository starred by ${stargazerCount.toLocaleString('us')} people`} + className="d-flex flex-items-center flex-justify-center mr-1 gap-1 color-fg-muted" + > <StarIcon className="ml-1" width={12} height={12}/> <span className="f6">{abbreviateNumber(stargazerCount)}</span> - </div>, + </a>, ); } } |