diff --git a/components/SocialLink.tsx b/components/SocialLink.tsx index 02380f4..5b9fad9 100644 --- a/components/SocialLink.tsx +++ b/components/SocialLink.tsx @@ -1,15 +1,17 @@ import Link from 'next/link' import {ElementType} from 'react' +import clsx from 'clsx' type SocialLink = { href: string ariaLabel: string icon: ElementType + className?: string } -export function SocialLink({icon: Icon, href, ariaLabel}: SocialLink) { +export function SocialLink({icon: Icon, href, ariaLabel, className}: SocialLink) { return ( - + diff --git a/components/StarIcon.tsx b/components/StarIcon.tsx new file mode 100644 index 0000000..0bcfb34 --- /dev/null +++ b/components/StarIcon.tsx @@ -0,0 +1,10 @@ +import {Props} from '@/types' + +export function StarIcon(props: Props) { + return ( + + + + ) +} \ No newline at end of file diff --git a/pages/projects.tsx b/pages/projects.tsx index 1df3149..fe8f423 100644 --- a/pages/projects.tsx +++ b/pages/projects.tsx @@ -1,9 +1,9 @@ +import {GetStaticProps} from 'next' import Head from 'next/head' import {Card} from '@/components/Card' import {SimpleLayout} from '@/components/SimpleLayout' -import {GitHubIcon} from '@/components/SocialIcons' import {SocialLink} from '@/components/SocialLink' -import {GetStaticProps} from 'next' +import {StarIcon} from '@/components/StarIcon' import {getPinnedRepos} from '@/lib/github' import type {Repo} from '@/types' @@ -36,19 +36,29 @@ export default function Projects({pinnedRepos}: { pinnedRepos: Repo[] }) { > {pinnedRepos.map((repo) => ( - + {repo.name} {repo.description} - - - {`r-freeman/${repo.name}`} - + + + {repo.primaryLanguage.name} + + + + {repo.stargazerCount} + + + ))} @@ -58,11 +68,10 @@ export default function Projects({pinnedRepos}: { pinnedRepos: Repo[] }) { } export const getStaticProps: GetStaticProps = async () => { - const pinnedRepos = await getPinnedRepos() - return { props: { - pinnedRepos + pinnedRepos: (await getPinnedRepos()) + .sort((a, b) => b.stargazerCount - a.stargazerCount) } } }
- - {`r-freeman/${repo.name}`} -
+ {repo.primaryLanguage.name} + +
+ {repo.stargazerCount} + +