mirror of
https://github.com/r-freeman/portfolio.git
synced 2024-11-11 18:45:41 +00:00
Updated dashboard
This commit is contained in:
parent
ab9c58116b
commit
d9d5becd8a
@ -9,33 +9,33 @@ export async function dashboard() {
|
||||
])
|
||||
|
||||
const totalStars = await getTotalStars(totalRepos)
|
||||
const articles = await getAllArticles()
|
||||
const {views} = await getViews()
|
||||
const totalArticles = (await getAllArticles()).length
|
||||
const totalArticleViews = (await getViews()).views
|
||||
|
||||
return [
|
||||
{
|
||||
title: "GitHub Repos",
|
||||
total: totalRepos,
|
||||
metric: totalRepos,
|
||||
href: "https://github.com/r-freeman?tab=repositories"
|
||||
},
|
||||
{
|
||||
title: "GitHub Followers",
|
||||
total: totalFollowers,
|
||||
metric: totalFollowers,
|
||||
href: "https://github.com/r-freeman?tab=followers"
|
||||
},
|
||||
{
|
||||
title: "GitHub Stars",
|
||||
total: totalStars,
|
||||
metric: totalStars,
|
||||
href: "https://github.com/r-freeman/"
|
||||
},
|
||||
{
|
||||
title: "Total Articles",
|
||||
total: articles.length,
|
||||
metric: totalArticles,
|
||||
href: "/writing"
|
||||
},
|
||||
{
|
||||
title: "Total Article Views",
|
||||
total: views,
|
||||
metric: totalArticleViews,
|
||||
href: "/writing"
|
||||
}
|
||||
]
|
||||
|
@ -7,7 +7,7 @@ import {dashboard} from '@/lib/dashboard'
|
||||
|
||||
type CardProps = {
|
||||
title: string
|
||||
total: number
|
||||
metric: number
|
||||
href: string
|
||||
}
|
||||
|
||||
@ -44,7 +44,7 @@ export default function Dashboard({cards}: { cards: CardProps[] }) {
|
||||
<Card.Link href={card.href}>{card.title}</Card.Link>
|
||||
</h2>
|
||||
<Card.Description className="text-zinc-800 dark:text-zinc-100 font-semibold text-5xl">
|
||||
{numberFormat(card.total)}
|
||||
{numberFormat(card.metric)}
|
||||
</Card.Description>
|
||||
</Card>
|
||||
))}
|
||||
@ -57,7 +57,7 @@ export default function Dashboard({cards}: { cards: CardProps[] }) {
|
||||
export const getStaticProps: GetStaticProps = async () => {
|
||||
return {
|
||||
props: {
|
||||
cards: (await dashboard())
|
||||
cards: await dashboard()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user