mirror of
https://github.com/r-freeman/portfolio.git
synced 2024-11-22 18:35:40 +00:00
Added fork count to projects
This commit is contained in:
parent
3c2e63e753
commit
819826422b
10
components/ForkIcon.tsx
Normal file
10
components/ForkIcon.tsx
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import type {Props} from '@/types'
|
||||||
|
|
||||||
|
export function ForkIcon(props: Props) {
|
||||||
|
return (
|
||||||
|
<svg viewBox="0 0 16 16" aria-label="forks" data-view-component="true" {...props}>
|
||||||
|
<path fillRule="evenodd"
|
||||||
|
d="M5 3.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0zm0 2.122a2.25 2.25 0 1 0-1.5 0v.878A2.25 2.25 0 0 0 5.75 8.5h1.5v2.128a2.251 2.251 0 1 0 1.5 0V8.5h1.5a2.25 2.25 0 0 0 2.25-2.25v-.878a2.25 2.25 0 1 0-1.5 0v.878a.75.75 0 0 1-.75.75h-4.5A.75.75 0 0 1 5 6.25v-.878zm3.75 7.378a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0zm3-8.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5z"/>
|
||||||
|
</svg>
|
||||||
|
)
|
||||||
|
}
|
@ -31,6 +31,7 @@ export async function getPinnedRepos() {
|
|||||||
description
|
description
|
||||||
url
|
url
|
||||||
stargazerCount
|
stargazerCount
|
||||||
|
forkCount
|
||||||
primaryLanguage {
|
primaryLanguage {
|
||||||
name
|
name
|
||||||
color
|
color
|
||||||
|
@ -4,6 +4,7 @@ import {Card} from '@/components/Card'
|
|||||||
import {SimpleLayout} from '@/components/SimpleLayout'
|
import {SimpleLayout} from '@/components/SimpleLayout'
|
||||||
import {SocialLink} from '@/components/SocialLink'
|
import {SocialLink} from '@/components/SocialLink'
|
||||||
import {StarIcon} from '@/components/StarIcon'
|
import {StarIcon} from '@/components/StarIcon'
|
||||||
|
import {ForkIcon} from '@/components/ForkIcon'
|
||||||
import {getPinnedRepos} from '@/lib/github'
|
import {getPinnedRepos} from '@/lib/github'
|
||||||
import {numberFormat} from '@/lib/numberFormat'
|
import {numberFormat} from '@/lib/numberFormat'
|
||||||
import type {Repo} from '@/types'
|
import type {Repo} from '@/types'
|
||||||
@ -50,6 +51,7 @@ export default function Projects({pinnedRepos}: { pinnedRepos: Repo[] }) {
|
|||||||
className="w-4 h-4 rounded-full order-first"
|
className="w-4 h-4 rounded-full order-first"
|
||||||
style={{backgroundColor: repo.primaryLanguage.color}}/>
|
style={{backgroundColor: repo.primaryLanguage.color}}/>
|
||||||
</p>
|
</p>
|
||||||
|
<div className="flex space-x-4">
|
||||||
<p className="relative z-10 flex items-center">
|
<p className="relative z-10 flex items-center">
|
||||||
<span className="ml-2 order-last">{numberFormat(repo.stargazerCount)}</span>
|
<span className="ml-2 order-last">{numberFormat(repo.stargazerCount)}</span>
|
||||||
<SocialLink
|
<SocialLink
|
||||||
@ -59,6 +61,16 @@ export default function Projects({pinnedRepos}: { pinnedRepos: Repo[] }) {
|
|||||||
className={'w-5 h-5'}
|
className={'w-5 h-5'}
|
||||||
/>
|
/>
|
||||||
</p>
|
</p>
|
||||||
|
<p className="relative z-10 flex items-center">
|
||||||
|
<span className="ml-2 order-last">{numberFormat(repo.forkCount)}</span>
|
||||||
|
<SocialLink
|
||||||
|
href={repo.url}
|
||||||
|
ariaLabel={`Fork ${repo.name} on GitHub`}
|
||||||
|
icon={ForkIcon}
|
||||||
|
className={'w-5 h-5'}
|
||||||
|
/>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Card>
|
</Card>
|
||||||
))}
|
))}
|
||||||
|
@ -17,6 +17,7 @@ export type Repo = {
|
|||||||
description: string
|
description: string
|
||||||
url: string
|
url: string
|
||||||
stargazerCount: number
|
stargazerCount: number
|
||||||
|
forkCount: number
|
||||||
primaryLanguage: {
|
primaryLanguage: {
|
||||||
name: string
|
name: string
|
||||||
color: string
|
color: string
|
||||||
|
Loading…
Reference in New Issue
Block a user