+ 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 && (
-
- )}