From 9684cf9d5277d55768bb0cdfde201f6b39133fb6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 22 Sep 2025 10:35:10 +0000 Subject: [PATCH 1/6] Initial plan From 588893bc7175c3a06564a987f1f0a033a63e4017 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 22 Sep 2025 10:49:34 +0000 Subject: [PATCH 2/6] Implement PR list modal feature for leaderboard Co-authored-by: Adez017 <142787780+Adez017@users.noreply.github.com> --- .../dashboard/LeaderBoard/PRListModal.tsx | 176 +++++++ .../dashboard/LeaderBoard/leaderboard.css | 439 ++++++++++++++++++ .../dashboard/LeaderBoard/leaderboard.tsx | 105 ++++- src/lib/statsProvider.tsx | 27 +- 4 files changed, 738 insertions(+), 9 deletions(-) create mode 100644 src/components/dashboard/LeaderBoard/PRListModal.tsx diff --git a/src/components/dashboard/LeaderBoard/PRListModal.tsx b/src/components/dashboard/LeaderBoard/PRListModal.tsx new file mode 100644 index 00000000..ace9e91c --- /dev/null +++ b/src/components/dashboard/LeaderBoard/PRListModal.tsx @@ -0,0 +1,176 @@ +// src/components/dashboard/LeaderBoard/PRListModal.tsx +import React from "react"; +import { motion, AnimatePresence } from "framer-motion"; +import { FaTimes, FaExternalLinkAlt, FaGithub } from "react-icons/fa"; +import { useColorMode } from "@docusaurus/theme-common"; + +interface PRDetails { + title: string; + url: string; + mergedAt: string; + repoName: string; + number: number; +} + +interface Contributor { + username: string; + avatar: string; + profile: string; + points: number; + prs: number; + prDetails?: PRDetails[]; +} + +interface PRListModalProps { + contributor: Contributor | null; + isOpen: boolean; + onClose: () => void; +} + +export default function PRListModal({ contributor, isOpen, onClose }: PRListModalProps): JSX.Element | null { + const { colorMode } = useColorMode(); + const isDark = colorMode === "dark"; + + if (!contributor) return null; + + const formatDate = (dateString: string) => { + const date = new Date(dateString); + return date.toLocaleDateString('en-US', { + year: 'numeric', + month: 'short', + day: 'numeric' + }); + }; + + const handleBackdropClick = (e: React.MouseEvent) => { + if (e.target === e.currentTarget) { + onClose(); + } + }; + + const handleKeyDown = (e: React.KeyboardEvent) => { + if (e.key === 'Escape') { + onClose(); + } + }; + + return ( + + {isOpen && ( + + + {/* Modal Header */} +
+
+ {contributor.username} +
+

+ {contributor.username}'s Pull Requests +

+

+ {contributor.prs} merged PR{contributor.prs !== 1 ? 's' : ''} • {contributor.points} points +

+
+
+ +
+ + {/* Modal Body */} +
+ {contributor.prDetails && contributor.prDetails.length > 0 ? ( +
+ {contributor.prDetails.map((pr, index) => ( + +
+

+ {pr.title} +

+
+ + + +
+
+
+ + + {pr.repoName} + + + #{pr.number} + + + Merged on {formatDate(pr.mergedAt)} + +
+
+ ))} +
+ ) : ( +
+ +

No pull request details available

+

+ PR details might not be loaded yet or this contributor has no merged PRs. +

+
+ )} +
+ + {/* Modal Footer */} +
+ + + View GitHub Profile + +
+
+
+ )} +
+ ); +} \ No newline at end of file diff --git a/src/components/dashboard/LeaderBoard/leaderboard.css b/src/components/dashboard/LeaderBoard/leaderboard.css index 802813f5..34572db1 100644 --- a/src/components/dashboard/LeaderBoard/leaderboard.css +++ b/src/components/dashboard/LeaderBoard/leaderboard.css @@ -419,6 +419,25 @@ font-weight: bold; } +.badge.clickable { + transition: all 0.2s ease; + position: relative; +} + +.badge.clickable:hover { + transform: translateY(-1px); + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); +} + +.badge.clickable:focus { + outline: 2px solid #6366f1; + outline-offset: 2px; +} + +.badge.clickable:active { + transform: translateY(0); +} + .rank-badge { display: flex; justify-content: center; @@ -689,4 +708,424 @@ height: 32px; font-size: 14px; } +} + +/* PR List Modal Styles */ +.pr-modal-backdrop { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + z-index: 1000; + display: flex; + align-items: center; + justify-content: center; + padding: 20px; + backdrop-filter: blur(4px); +} + +.pr-modal-backdrop.light { + background: rgba(0, 0, 0, 0.5); +} + +.pr-modal-backdrop.dark { + background: rgba(0, 0, 0, 0.7); +} + +.pr-modal-container { + width: 100%; + max-width: 700px; + max-height: 80vh; + border-radius: 16px; + box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); + overflow: hidden; + display: flex; + flex-direction: column; +} + +.pr-modal-container.light { + background: white; + border: 1px solid #e5e7eb; +} + +.pr-modal-container.dark { + background: #1f2937; + border: 1px solid #374151; +} + +/* Modal Header */ +.pr-modal-header { + padding: 24px 24px 16px; + border-bottom: 1px solid; + display: flex; + align-items: center; + justify-content: space-between; + flex-shrink: 0; +} + +.pr-modal-header.light { + border-color: #e5e7eb; + background: #fafafa; +} + +.pr-modal-header.dark { + border-color: #374151; + background: #111827; +} + +.pr-modal-user-info { + display: flex; + align-items: center; + gap: 16px; +} + +.pr-modal-avatar { + width: 48px; + height: 48px; + border-radius: 50%; + border: 2px solid; +} + +.pr-modal-container.light .pr-modal-avatar { + border-color: #e5e7eb; +} + +.pr-modal-container.dark .pr-modal-avatar { + border-color: #374151; +} + +.pr-modal-title { + font-size: 20px; + font-weight: 600; + margin: 0 0 4px 0; +} + +.pr-modal-title.light { + color: #111827; +} + +.pr-modal-title.dark { + color: #f9fafb; +} + +.pr-modal-subtitle { + font-size: 14px; + margin: 0; + opacity: 0.7; +} + +.pr-modal-subtitle.light { + color: #6b7280; +} + +.pr-modal-subtitle.dark { + color: #9ca3af; +} + +.pr-modal-close { + width: 40px; + height: 40px; + border-radius: 8px; + border: none; + display: flex; + align-items: center; + justify-content: center; + cursor: pointer; + transition: all 0.2s ease; + flex-shrink: 0; +} + +.pr-modal-close.light { + background: #f3f4f6; + color: #6b7280; +} + +.pr-modal-close.light:hover { + background: #e5e7eb; + color: #374151; +} + +.pr-modal-close.dark { + background: #374151; + color: #9ca3af; +} + +.pr-modal-close.dark:hover { + background: #4b5563; + color: #f3f4f6; +} + +/* Modal Body */ +.pr-modal-body { + flex: 1; + overflow-y: auto; + padding: 0 24px; +} + +.pr-list { + display: flex; + flex-direction: column; + gap: 12px; + padding: 16px 0; +} + +.pr-item { + padding: 16px; + border-radius: 8px; + border: 1px solid; + transition: all 0.2s ease; +} + +.pr-item.light { + background: #fafafa; + border-color: #e5e7eb; +} + +.pr-item.light:hover { + background: #f3f4f6; + border-color: #d1d5db; +} + +.pr-item.dark { + background: #111827; + border-color: #374151; +} + +.pr-item.dark:hover { + background: #1f2937; + border-color: #4b5563; +} + +.pr-item-header { + display: flex; + align-items: flex-start; + justify-content: space-between; + gap: 12px; + margin-bottom: 8px; +} + +.pr-item-title { + font-size: 16px; + font-weight: 500; + margin: 0; + line-height: 1.4; + flex: 1; +} + +.pr-item-title.light { + color: #111827; +} + +.pr-item-title.dark { + color: #f9fafb; +} + +.pr-item-actions { + display: flex; + gap: 8px; + flex-shrink: 0; +} + +.pr-item-link { + width: 32px; + height: 32px; + border-radius: 6px; + display: flex; + align-items: center; + justify-content: center; + text-decoration: none; + transition: all 0.2s ease; + border: 1px solid; +} + +.pr-item-link.light { + background: #f9fafb; + border-color: #e5e7eb; + color: #6b7280; +} + +.pr-item-link.light:hover { + background: #f3f4f6; + border-color: #d1d5db; + color: #374151; +} + +.pr-item-link.dark { + background: #374151; + border-color: #4b5563; + color: #9ca3af; +} + +.pr-item-link.dark:hover { + background: #4b5563; + border-color: #6b7280; + color: #f3f4f6; +} + +.pr-item-meta { + display: flex; + align-items: center; + gap: 16px; + flex-wrap: wrap; + font-size: 13px; + opacity: 0.8; +} + +.pr-item-repo { + display: flex; + align-items: center; + gap: 6px; + font-weight: 500; +} + +.pr-item-repo.light { + color: #6366f1; +} + +.pr-item-repo.dark { + color: #818cf8; +} + +.pr-item-number { + font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace; + font-weight: 500; +} + +.pr-item-number.light { + color: #059669; +} + +.pr-item-number.dark { + color: #10b981; +} + +.pr-item-date.light { + color: #6b7280; +} + +.pr-item-date.dark { + color: #9ca3af; +} + +/* Empty State */ +.pr-empty-state { + text-align: center; + padding: 48px 24px; +} + +.pr-empty-icon { + font-size: 48px; + margin-bottom: 16px; + opacity: 0.4; +} + +.pr-empty-state p { + margin: 0 0 8px 0; + font-size: 16px; + font-weight: 500; +} + +.pr-empty-state.light p { + color: #374151; +} + +.pr-empty-state.dark p { + color: #d1d5db; +} + +.pr-empty-subtitle { + font-size: 14px !important; + font-weight: 400 !important; + opacity: 0.7; + max-width: 300px; + margin: 0 auto !important; +} + +/* Modal Footer */ +.pr-modal-footer { + padding: 16px 24px 24px; + border-top: 1px solid; + flex-shrink: 0; +} + +.pr-modal-footer.light { + border-color: #e5e7eb; + background: #fafafa; +} + +.pr-modal-footer.dark { + border-color: #374151; + background: #111827; +} + +.pr-modal-profile-link { + display: inline-flex; + align-items: center; + gap: 8px; + padding: 8px 16px; + border-radius: 8px; + text-decoration: none; + font-size: 14px; + font-weight: 500; + transition: all 0.2s ease; + border: 1px solid; +} + +.pr-modal-profile-link.light { + background: #f3f4f6; + border-color: #d1d5db; + color: #374151; +} + +.pr-modal-profile-link.light:hover { + background: #e5e7eb; + border-color: #9ca3af; + color: #111827; +} + +.pr-modal-profile-link.dark { + background: #374151; + border-color: #4b5563; + color: #d1d5db; +} + +.pr-modal-profile-link.dark:hover { + background: #4b5563; + border-color: #6b7280; + color: #f9fafb; +} + +/* Responsive Design */ +@media (max-width: 768px) { + .pr-modal-container { + max-height: 90vh; + margin: 20px; + } + + .pr-modal-header { + padding: 20px 20px 12px; + } + + .pr-modal-body { + padding: 0 20px; + } + + .pr-modal-footer { + padding: 12px 20px 20px; + } + + .pr-item-header { + flex-direction: column; + align-items: flex-start; + gap: 8px; + } + + .pr-item-actions { + align-self: flex-end; + } + + .pr-item-meta { + gap: 12px; + } } \ No newline at end of file diff --git a/src/components/dashboard/LeaderBoard/leaderboard.tsx b/src/components/dashboard/LeaderBoard/leaderboard.tsx index c9aa0344..abad538f 100644 --- a/src/components/dashboard/LeaderBoard/leaderboard.tsx +++ b/src/components/dashboard/LeaderBoard/leaderboard.tsx @@ -12,6 +12,7 @@ import { import { ChevronRight, ChevronLeft } from "lucide-react"; import { useColorMode } from "@docusaurus/theme-common"; import { useCommunityStatsContext } from "@site/src/lib/statsProvider"; +import PRListModal from "./PRListModal"; import "./leaderboard.css"; const GITHUB_ORG = "recodehive"; @@ -19,12 +20,21 @@ const GITHUB_ORG = "recodehive"; // Users to exclude from the leaderboard const EXCLUDED_USERS = ["sanjay-kv", "allcontributors", "allcontributors[bot]"]; +interface PRDetails { + title: string; + url: string; + mergedAt: string; + repoName: string; + number: number; +} + interface Contributor { username: string; avatar: string; profile: string; points: number; prs: number; + prDetails?: PRDetails[]; } interface Stats { @@ -33,15 +43,62 @@ interface Stats { flooredTotalPoints: number; } -function Badge({ count, label, color }: { count: number; label: string; color: { background: string; color: string } }) { +function Badge({ + count, + label, + color, + onClick, + clickable = false +}: { + count: number; + label: string; + color: { background: string; color: string }; + onClick?: () => void; + clickable?: boolean; +}) { + const badgeStyle = { + ...color, + cursor: clickable ? 'pointer' : 'default', + transition: clickable ? 'all 0.2s ease' : 'none', + }; + + const handleClick = () => { + if (clickable && onClick) { + onClick(); + } + }; + + const handleKeyDown = (e: React.KeyboardEvent) => { + if (clickable && (e.key === 'Enter' || e.key === ' ')) { + e.preventDefault(); + if (onClick) onClick(); + } + }; + return ( - + {count} {label} ); } -function TopPerformerCard({ contributor, rank }: { contributor: Contributor; rank: number }) { +function TopPerformerCard({ + contributor, + rank, + onPRClick +}: { + contributor: Contributor; + rank: number; + onPRClick: (contributor: Contributor) => void; +}) { const { colorMode } = useColorMode(); const isDark = colorMode === "dark"; const rankClass = rank === 1 ? "top-1" : rank === 2 ? "top-2" : "top-3"; @@ -57,7 +114,13 @@ function TopPerformerCard({ contributor, rank }: { contributor: Contributor; ran {contributor.username}
- + onPRClick(contributor)} + clickable={true} + />
@@ -72,8 +135,21 @@ export default function LeaderBoard(): JSX.Element { const [searchQuery, setSearchQuery] = useState(""); const [currentPage, setCurrentPage] = useState(1); + const [selectedContributor, setSelectedContributor] = useState(null); + const [isModalOpen, setIsModalOpen] = useState(false); const itemsPerPage = 10; + // Modal handlers + const handlePRClick = (contributor: Contributor) => { + setSelectedContributor(contributor); + setIsModalOpen(true); + }; + + const handleCloseModal = () => { + setIsModalOpen(false); + setSelectedContributor(null); + }; + // Filter out excluded users and then apply search filter const filteredContributors = contributors .filter((contributor) => @@ -210,9 +286,9 @@ export default function LeaderBoard(): JSX.Element {

RecodeHive Top Performers

- - - + + +
)} @@ -343,7 +419,13 @@ export default function LeaderBoard(): JSX.Element {
- + handlePRClick(contributor)} + clickable={true} + />
@@ -388,6 +470,13 @@ export default function LeaderBoard(): JSX.Element {
)} + + {/* PR List Modal */} + ); } \ No newline at end of file diff --git a/src/lib/statsProvider.tsx b/src/lib/statsProvider.tsx index 09d6bf60..7455e9aa 100644 --- a/src/lib/statsProvider.tsx +++ b/src/lib/statsProvider.tsx @@ -34,12 +34,21 @@ interface ICommunityStatsContext { } // Define types for leaderboard data +interface PRDetails { + title: string; + url: string; + mergedAt: string; + repoName: string; + number: number; +} + interface Contributor { username: string; avatar: string; profile: string; points: number; prs: number; + prDetails?: PRDetails[]; } interface Stats { @@ -55,6 +64,9 @@ interface PullRequestItem { html_url: string; }; merged_at?: string | null; + title?: string; + html_url?: string; + number?: number; } export const CommunityStatsContext = createContext(undefined); @@ -196,7 +208,7 @@ export function CommunityStatsProvider({ children }: CommunityStatsProviderProps const results = await Promise.all(promises); // Process results from this batch - results.forEach(({ mergedPRs }) => { + results.forEach(({ mergedPRs, repoName }) => { totalMergedPRs += mergedPRs.length; mergedPRs.forEach((pr) => { @@ -208,11 +220,24 @@ export function CommunityStatsProvider({ children }: CommunityStatsProviderProps profile: pr.user.html_url, points: 0, prs: 0, + prDetails: [], }); } const contributor = contributorMap.get(username)!; contributor.prs++; contributor.points += POINTS_PER_PR; + + // Add detailed PR information + if (pr.title && pr.html_url && pr.merged_at && pr.number) { + contributor.prDetails = contributor.prDetails || []; + contributor.prDetails.push({ + title: pr.title, + url: pr.html_url, + mergedAt: pr.merged_at, + repoName, + number: pr.number, + }); + } }); }); } From 5d5e4d5e4f892cb9e4306c86150baaea1f68bf40 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 22 Sep 2025 10:53:22 +0000 Subject: [PATCH 3/6] Add mock data for testing PR list modal functionality Co-authored-by: Adez017 <142787780+Adez017@users.noreply.github.com> --- .../dashboard/LeaderBoard/leaderboard.tsx | 27 ++++- .../dashboard/LeaderBoard/mockData.ts | 100 ++++++++++++++++++ 2 files changed, 122 insertions(+), 5 deletions(-) create mode 100644 src/components/dashboard/LeaderBoard/mockData.ts diff --git a/src/components/dashboard/LeaderBoard/leaderboard.tsx b/src/components/dashboard/LeaderBoard/leaderboard.tsx index abad538f..78b4e477 100644 --- a/src/components/dashboard/LeaderBoard/leaderboard.tsx +++ b/src/components/dashboard/LeaderBoard/leaderboard.tsx @@ -13,6 +13,7 @@ import { ChevronRight, ChevronLeft } from "lucide-react"; import { useColorMode } from "@docusaurus/theme-common"; import { useCommunityStatsContext } from "@site/src/lib/statsProvider"; import PRListModal from "./PRListModal"; +import { mockContributors } from "./mockData"; import "./leaderboard.css"; const GITHUB_ORG = "recodehive"; @@ -150,8 +151,11 @@ export default function LeaderBoard(): JSX.Element { setSelectedContributor(null); }; + // Use mock data when there's an error or no contributors + const displayContributors = error || contributors.length === 0 ? mockContributors : contributors; + // Filter out excluded users and then apply search filter - const filteredContributors = contributors + const filteredContributors = displayContributors .filter((contributor) => !EXCLUDED_USERS.some(excludedUser => contributor.username.toLowerCase() === excludedUser.toLowerCase() @@ -282,7 +286,7 @@ export default function LeaderBoard(): JSX.Element { {/* Top 3 Performers Section */} - {!loading && !error && filteredContributors.length > 2 && ( + {!loading && filteredContributors.length > 2 && (

RecodeHive Top Performers

@@ -372,20 +376,33 @@ export default function LeaderBoard(): JSX.Element {
)} - {error && ( + {error && displayContributors.length === 0 && (

Error: {error}

)} - {!loading && !error && filteredContributors.length === 0 && ( + {!loading && filteredContributors.length === 0 && (

No contributors found.

)} - {!loading && !error && filteredContributors.length > 0 && ( + {!loading && filteredContributors.length > 0 && (
+ {error && ( +
+ Demo Mode: Showing sample data due to API configuration issue +
+ )}
Rank
Avatar
diff --git a/src/components/dashboard/LeaderBoard/mockData.ts b/src/components/dashboard/LeaderBoard/mockData.ts new file mode 100644 index 00000000..19193cae --- /dev/null +++ b/src/components/dashboard/LeaderBoard/mockData.ts @@ -0,0 +1,100 @@ +// Temporary mock data for testing the PR list modal functionality +export const mockContributors = [ + { + username: "testuser1", + avatar: "https://github.com/testuser1.png", + profile: "https://github.com/testuser1", + points: 50, + prs: 5, + prDetails: [ + { + title: "Add new feature: user authentication system", + url: "https://github.com/recodehive/repo1/pull/123", + mergedAt: "2024-01-15T10:30:00Z", + repoName: "auth-service", + number: 123 + }, + { + title: "Fix: resolve security vulnerability in login flow", + url: "https://github.com/recodehive/repo1/pull/124", + mergedAt: "2024-01-14T14:22:00Z", + repoName: "auth-service", + number: 124 + }, + { + title: "Update documentation for API endpoints", + url: "https://github.com/recodehive/repo2/pull/45", + mergedAt: "2024-01-13T09:15:00Z", + repoName: "api-docs", + number: 45 + }, + { + title: "Implement dark mode toggle component", + url: "https://github.com/recodehive/repo3/pull/67", + mergedAt: "2024-01-12T16:45:00Z", + repoName: "ui-components", + number: 67 + }, + { + title: "Optimize database queries for better performance", + url: "https://github.com/recodehive/repo1/pull/125", + mergedAt: "2024-01-11T11:30:00Z", + repoName: "backend-core", + number: 125 + } + ] + }, + { + username: "testuser2", + avatar: "https://github.com/testuser2.png", + profile: "https://github.com/testuser2", + points: 30, + prs: 3, + prDetails: [ + { + title: "Add responsive design to landing page", + url: "https://github.com/recodehive/repo4/pull/89", + mergedAt: "2024-01-10T13:20:00Z", + repoName: "frontend-website", + number: 89 + }, + { + title: "Fix mobile navigation menu issue", + url: "https://github.com/recodehive/repo4/pull/90", + mergedAt: "2024-01-09T08:45:00Z", + repoName: "frontend-website", + number: 90 + }, + { + title: "Add unit tests for utility functions", + url: "https://github.com/recodehive/repo5/pull/12", + mergedAt: "2024-01-08T15:30:00Z", + repoName: "utils-library", + number: 12 + } + ] + }, + { + username: "testuser3", + avatar: "https://github.com/testuser3.png", + profile: "https://github.com/testuser3", + points: 20, + prs: 2, + prDetails: [ + { + title: "Update README with installation instructions", + url: "https://github.com/recodehive/repo6/pull/23", + mergedAt: "2024-01-07T12:15:00Z", + repoName: "documentation", + number: 23 + }, + { + title: "Add error handling for API failures", + url: "https://github.com/recodehive/repo7/pull/34", + mergedAt: "2024-01-06T10:00:00Z", + repoName: "error-handling", + number: 34 + } + ] + } +]; \ No newline at end of file From 1affcc6b6e0073dacd5f6c0c6455deaef41cfa33 Mon Sep 17 00:00:00 2001 From: aditya singh rathore <142787780+Adez017@users.noreply.github.com> Date: Mon, 22 Sep 2025 21:40:26 +0530 Subject: [PATCH 4/6] Update src/components/dashboard/LeaderBoard/leaderboard.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/components/dashboard/LeaderBoard/leaderboard.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/dashboard/LeaderBoard/leaderboard.tsx b/src/components/dashboard/LeaderBoard/leaderboard.tsx index 78b4e477..f399f216 100644 --- a/src/components/dashboard/LeaderBoard/leaderboard.tsx +++ b/src/components/dashboard/LeaderBoard/leaderboard.tsx @@ -151,8 +151,13 @@ export default function LeaderBoard(): JSX.Element { setSelectedContributor(null); }; - // Use mock data when there's an error or no contributors - const displayContributors = error || contributors.length === 0 ? mockContributors : contributors; + // Use mock data only in development mode when there's an error or no contributors + const displayContributors = + (error || contributors.length === 0) + ? (typeof process !== "undefined" && process.env.NODE_ENV === "development" + ? mockContributors + : []) + : contributors; // Filter out excluded users and then apply search filter const filteredContributors = displayContributors From 56544701551b5f1173c138d3072ec69743dfe8ac Mon Sep 17 00:00:00 2001 From: aditya singh rathore Date: Tue, 23 Sep 2025 18:02:40 +0530 Subject: [PATCH 5/6] quick fix --- .../dashboard/LeaderBoard/leaderboard.tsx | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/components/dashboard/LeaderBoard/leaderboard.tsx b/src/components/dashboard/LeaderBoard/leaderboard.tsx index fe2f70de..2c1b2491 100644 --- a/src/components/dashboard/LeaderBoard/leaderboard.tsx +++ b/src/components/dashboard/LeaderBoard/leaderboard.tsx @@ -163,10 +163,10 @@ export default function LeaderBoard(): JSX.Element { : contributors; // Filter out excluded users and then apply search filter - const filteredContributors = displayContributors + const [timePeriod, setTimePeriod] = useState("all"); const [isSelectChanged, setIsSelectChanged] = useState(false); - const itemsPerPage = 10; + // Get contributions within the selected time period const getContributionsWithinTimePeriod = (contributors: Contributor[]) => { @@ -390,15 +390,6 @@ export default function LeaderBoard(): JSX.Element { - {filteredContributors.length >= 2 && ( - - )} - {filteredContributors.length >= 1 && ( - - )} - {filteredContributors.length >= 3 && ( - - )}
)} From a5d396156819562a1ddf5c1acc3eac9088fd63cf Mon Sep 17 00:00:00 2001 From: aditya singh rathore <142787780+Adez017@users.noreply.github.com> Date: Tue, 23 Sep 2025 18:15:37 +0530 Subject: [PATCH 6/6] Update src/components/dashboard/LeaderBoard/leaderboard.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/components/dashboard/LeaderBoard/leaderboard.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/dashboard/LeaderBoard/leaderboard.tsx b/src/components/dashboard/LeaderBoard/leaderboard.tsx index 2c1b2491..a2770b6c 100644 --- a/src/components/dashboard/LeaderBoard/leaderboard.tsx +++ b/src/components/dashboard/LeaderBoard/leaderboard.tsx @@ -162,7 +162,6 @@ export default function LeaderBoard(): JSX.Element { : []) : contributors; - // Filter out excluded users and then apply search filter const [timePeriod, setTimePeriod] = useState("all"); const [isSelectChanged, setIsSelectChanged] = useState(false);