diff --git a/src/App.tsx b/src/App.tsx
index a49da65..e9adacf 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -1,4 +1,3 @@
-
import Navbar from "./components/Navbar";
import Footer from "./components/Footer";
import ScrollProgressBar from './components/ScrollProgressBar';
diff --git a/src/Routes/Router.tsx b/src/Routes/Router.tsx
index b6bce37..007d11d 100644
--- a/src/Routes/Router.tsx
+++ b/src/Routes/Router.tsx
@@ -6,7 +6,7 @@ import Contact from "../pages/Contact/Contact"; // Import the Contact component
import Contributors from "../pages/Contributors/Contributors";
import Signup from "../pages/Signup/Signup.tsx";
import Login from "../pages/Login/Login.tsx";
-
+import UserProfile from "../pages/UserProfile/UserProfile.tsx";
const Router = () => {
return (
@@ -19,6 +19,7 @@ const Router = () => {
} />
} />
} />
+ } />
);
};
diff --git a/src/pages/Contributors/Contributors.tsx b/src/pages/Contributors/Contributors.tsx
index c72de46..ab9de23 100644
--- a/src/pages/Contributors/Contributors.tsx
+++ b/src/pages/Contributors/Contributors.tsx
@@ -13,6 +13,7 @@ import {
} from "@mui/material";
import { FaGithub } from "react-icons/fa";
import axios from "axios";
+import { Link } from "react-router-dom"; // ✅ Added
interface Contributor {
id: number;
@@ -30,7 +31,8 @@ const ContributorsPage = () => {
useEffect(() => {
const fetchContributors = async () => {
try {
- const response = await axios.get("https://api.github.com/repos/GitMetricsLab/github_tracker/contributors",
+ const response = await axios.get(
+ "https://api.github.com/repos/GitMetricsLab/github_tracker/contributors",
{ withCredentials: false }
);
setContributors(response.data);
@@ -84,76 +86,83 @@ const ContributorsPage = () => {
{contributors.map((contributor) => (
-
-
-
-
+
- {contributor.login}
-
-
- {contributor.contributions} Contributions
-
-
- Thank you for your valuable contributions!
-
-
- }
- href={contributor.html_url}
- target="_blank"
+ />
+
+
- GitHub Profile
-
-
-
-
+ {contributor.login}
+
+
+ {contributor.contributions} Contributions
+
+
+ Thank you for your valuable contributions!
+
+
+ }
+ href={contributor.html_url}
+ target="_blank"
+ sx={{
+ backgroundColor: "#24292f",
+ color: "#fff",
+ fontSize: { xs: "0.75rem", sm: "0.85rem" },
+ px: 2,
+ py: 1,
+ "&:hover": {
+ backgroundColor: "#444",
+ },
+ }}
+ onClick={(e) => e.stopPropagation()} // prevent nested Link trigger
+ >
+ GitHub Profile
+
+
+
+
+
))}
diff --git a/src/pages/UserProfile/UserProfile.tsx b/src/pages/UserProfile/UserProfile.tsx
new file mode 100644
index 0000000..abf9791
--- /dev/null
+++ b/src/pages/UserProfile/UserProfile.tsx
@@ -0,0 +1,57 @@
+import { useParams } from "react-router-dom";
+import { useEffect, useState } from "react";
+
+type PR = {
+ title: string;
+ html_url: string;
+ repository_url: string;
+};
+
+export default function UserProfile() {
+ const { username } = useParams();
+ const [profile, setProfile] = useState(null);
+ const [prs, setPRs] = useState([]);
+ const [loading, setLoading] = useState(true);
+
+ useEffect(() => {
+ async function fetchData() {
+ if (!username) return;
+
+ const userRes = await fetch(`https://api.github.com/users/${username}`);
+ const userData = await userRes.json();
+ setProfile(userData);
+
+ const prsRes = await fetch(`https://api.github.com/search/issues?q=author:${username}+type:pr`);
+ const prsData = await prsRes.json();
+ setPRs(prsData.items);
+ setLoading(false);
+ }
+
+ fetchData();
+ }, [username]);
+
+ if (loading) return Loading...
;
+
+ return (
+
+ {profile && (
+
+

+
{profile.login}
+
{profile.bio}
+
+ )}
+
+
Pull Requests
+
+
+ );
+}