From 78216ec5f0d0a9755bf1cea5198733729cdf8bdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateus=20Felipe=20Gon=C3=A7alves?= Date: Fri, 29 Dec 2023 18:02:38 +0000 Subject: [PATCH] feat(statistics): update github-contribution-calendar --- .../github-dashboard/cards/followers.tsx | 2 +- .../github-dashboard/cards/graph.tsx | 34 +++++++++---------- .../components/github-dashboard/index.tsx | 4 +-- .../github-dashboard/skeleton/follower.tsx | 2 +- .../github-dashboard/skeleton/graph.tsx | 10 +++--- .../github-dashboard/skeleton/index.tsx | 4 +-- src/styles/components.css | 8 +++++ 7 files changed, 37 insertions(+), 27 deletions(-) diff --git a/src/app/about/statistics/components/github-dashboard/cards/followers.tsx b/src/app/about/statistics/components/github-dashboard/cards/followers.tsx index 50a8e6ef..66b1e8a0 100644 --- a/src/app/about/statistics/components/github-dashboard/cards/followers.tsx +++ b/src/app/about/statistics/components/github-dashboard/cards/followers.tsx @@ -5,7 +5,7 @@ import { placeholder } from '@/shared/lib/placeholder' import { shuffleArray } from '@/shared/lib/shuffleArray' import { getGithubFollowers, getGithubUserData } from '@/shared/lib/github' -const AVATAR_COUNT = 119 +const AVATAR_COUNT = 71 export async function Followers() { const { followers: followersNumber } = await getGithubUserData() diff --git a/src/app/about/statistics/components/github-dashboard/cards/graph.tsx b/src/app/about/statistics/components/github-dashboard/cards/graph.tsx index cf0a59ec..47acf8cc 100644 --- a/src/app/about/statistics/components/github-dashboard/cards/graph.tsx +++ b/src/app/about/statistics/components/github-dashboard/cards/graph.tsx @@ -1,8 +1,14 @@ -import Image from 'next/image' +'use client' + import { CalendarBlank } from '@phosphor-icons/react/dist/ssr' -import { placeholder } from '@/shared/lib/placeholder' +import GitHubCalendar from 'react-github-calendar' +import { useTheme } from 'next-themes' export function Graph() { + const { theme } = useTheme() + + const colorScheme = theme !== 'dark' && theme !== 'light' ? undefined : theme + return (
@@ -10,21 +16,15 @@ export function Graph() {
- Contribution Graph - Contribution Graph
diff --git a/src/app/about/statistics/components/github-dashboard/index.tsx b/src/app/about/statistics/components/github-dashboard/index.tsx index bc78f02b..b2540ba8 100644 --- a/src/app/about/statistics/components/github-dashboard/index.tsx +++ b/src/app/about/statistics/components/github-dashboard/index.tsx @@ -16,7 +16,7 @@ export function GithubDashboard() { }> }>
-
+
@@ -25,7 +25,7 @@ export function GithubDashboard() { -
+
diff --git a/src/app/about/statistics/components/github-dashboard/skeleton/follower.tsx b/src/app/about/statistics/components/github-dashboard/skeleton/follower.tsx index acb99cd3..04570e4b 100644 --- a/src/app/about/statistics/components/github-dashboard/skeleton/follower.tsx +++ b/src/app/about/statistics/components/github-dashboard/skeleton/follower.tsx @@ -9,7 +9,7 @@ export const FollowersSkeleton = () => {
- {[...Array(119 + 1)].map((e, i) => ( + {[...Array(71 + 1)].map((e, i) => (
Contribution Graph -
-
+
+
+
+
+
+
) diff --git a/src/app/about/statistics/components/github-dashboard/skeleton/index.tsx b/src/app/about/statistics/components/github-dashboard/skeleton/index.tsx index 3eb41c79..1d88f3b9 100644 --- a/src/app/about/statistics/components/github-dashboard/skeleton/index.tsx +++ b/src/app/about/statistics/components/github-dashboard/skeleton/index.tsx @@ -8,7 +8,7 @@ import { GraphSkeleton } from './graph' export function GithubStatsSkeleton() { return (
-
+
@@ -18,7 +18,7 @@ export function GithubStatsSkeleton() { -
+
diff --git a/src/styles/components.css b/src/styles/components.css index a922528d..2631580c 100644 --- a/src/styles/components.css +++ b/src/styles/components.css @@ -316,4 +316,12 @@ @apply my-4 border-red-600 last:mb-0 [&:nth-child(2)]:mt-0; } } + + article { + div { + svg { + @apply w-full; + } + } + } }