Skip to content

Commit

Permalink
github stats
Browse files Browse the repository at this point in the history
  • Loading branch information
dietrichmax committed Mar 21, 2024
1 parent 58e2efd commit 3c30f70
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions pages/stats/index.tsx
Expand Up @@ -209,7 +209,7 @@ const DateWrapper = styled.div`
margin-right: calc(var(--space-sm) * 0.3);
`

const Date = styled.p`
const DateContent = styled.p`
font-size: 0.625rem;
display: block;
width: 100%;
Expand Down Expand Up @@ -377,7 +377,10 @@ export default function Dashboard({
const githubUrl: string = "https://github.com/dietrichmax"
const forkUrl: string = `${githubStats.user.repository.url}/fork`
const starUrl: string = githubStats.user.repository.url
const repositoryCreatedAt: string = new Date(githubStats.user.repository.createdAt).toLocaleDateString("en-US", { year: "numeric", month: "long", day: "numeric" })
const repositoryPushedAt: string = new Date(githubStats.user.repository.pushedAt).toLocaleDateString("en-US", { year: "numeric", month: "long", day: "numeric", hour: "2-digit", minute: "2-digit" })

//.toLocaleDateString("en-US")
/*const mostViewedPosts = []
function getMostViewedPosts(topPosts) {
async function getPostAttributes(post) {
Expand Down Expand Up @@ -638,7 +641,7 @@ export default function Dashboard({
<DateContainer>
{pageViews.map((item, i) => (
<DateWrapper key={i}>
<Date title={item.date}>{item.dateShort}</Date>
<DateContent title={item.date}>{item.dateShort}</DateContent >
</DateWrapper>
))}
</DateContainer>
Expand Down Expand Up @@ -669,7 +672,7 @@ export default function Dashboard({
<Title>GitHub Repository</Title>
<p>
This site's repository has been starred <Stats>{stars}</Stats>{" "}
times and forked <Stats>{forkCount}</Stats> times.
times and forked <Stats>{forkCount}</Stats> times since {repositoryCreatedAt}. <br/> The last push is from {repositoryPushedAt}.
</p>
<GitHubButtonWrapper>
<GitHubButtonLink href={githubUrl} title="GitHub - DaTurboD">
Expand Down
2 changes: 1 addition & 1 deletion src/data/external/github.ts
Expand Up @@ -6,7 +6,7 @@ export async function getGitHubStats() {
query: `query {
user(login: "dietrichmax") {
name
repository(name: "mxd-codes-frontend") {
repository(name: "personal-site") {
id
createdAt
url
Expand Down

0 comments on commit 3c30f70

Please sign in to comment.