diff --git a/backend/package.json b/backend/package.json index 89507d5..c23e3df 100644 --- a/backend/package.json +++ b/backend/package.json @@ -11,6 +11,7 @@ "license": "ISC", "description": "", "dependencies": { + "backend": "file:", "bcryptjs": "^2.4.3", "body-parser": "^1.20.3", "dotenv": "^16.4.5", diff --git a/package.json b/package.json index 5f47253..60aeb0a 100644 --- a/package.json +++ b/package.json @@ -16,12 +16,14 @@ "@mui/material": "^5.15.6", "@vitejs/plugin-react": "^4.3.3", "axios": "^1.7.7", + "my-react-tailwind-app": "file:", "octokit": "^4.0.2", "react": "^18.3.1", "react-dom": "^18.3.1", "react-hot-toast": "^2.4.1", "react-icons": "^5.3.0", - "react-router-dom": "^6.28.0" + "react-router-dom": "^6.28.0", + "recharts": "^2.13.3" }, "devDependencies": { "@eslint/js": "^9.13.0", diff --git a/src/Routes/Router.tsx b/src/Routes/Router.tsx index f21b686..ad25db9 100644 --- a/src/Routes/Router.tsx +++ b/src/Routes/Router.tsx @@ -5,6 +5,7 @@ import Home from "../pages/Home/Home"; // Import the Home (Dashboard) component import About from "../pages/About/About"; // Import the About component import Contact from "../pages/Contact/Contact"; // Import the Contact component import Contributors from "../pages/Contributors/Contributors"; +import Profile from "../pages/Profile/Profile"; const Router = () => { return ( @@ -15,6 +16,7 @@ const Router = () => { } /> } /> } /> + }/> ); }; diff --git a/src/components/ChartComponent.tsx b/src/components/ChartComponent.tsx new file mode 100644 index 0000000..2c13928 --- /dev/null +++ b/src/components/ChartComponent.tsx @@ -0,0 +1,57 @@ +import { + AreaChart, + Area, + XAxis, + YAxis, + CartesianGrid, + Tooltip, + ResponsiveContainer, +} from "recharts"; + +const contributionData = [ + { month: "Jan", contributions: 1 }, + { month: "Feb", contributions: 2 }, + { month: "Mar", contributions: 5 }, + { month: "Apr", contributions: 7 }, + { month: "May", contributions: 10 }, + { month: "Jun", contributions: 8 }, + { month: "Jul", contributions: 9 }, + { month: "Aug", contributions: 1 }, + { month: "Sep", contributions: 13 }, + { month: "Oct", contributions: 15 }, + { month: "Nov", contributions: 17 }, + { month: "Dec", contributions: 2 }, +]; + +const ChartComponent = () => { + return ( +
+

+ Total Contributions +

+ + + + + + + + + + {/* + */} + + + + +
+ ); +}; + +export default ChartComponent; diff --git a/src/components/ContributionGrid.tsx b/src/components/ContributionGrid.tsx new file mode 100644 index 0000000..7a4981a --- /dev/null +++ b/src/components/ContributionGrid.tsx @@ -0,0 +1,77 @@ +const ContributionGrid = () => { + // Contribution data with varying intensity values + const months = [ + { + name: "Jan", + contributions: [ + 0, 1, 2, 3, 1, 0, 2, 3, 0, 1, 2, 3, 1, 0, 2, 0, 1, 3, 2, 1, 0, 1, 3, 0, + 2, 1, 3, 0, 1, 2, 3, + ], + }, + { + name: "Feb", + contributions: [ + 1, 2, 0, 3, 0, 1, 2, 3, 0, 1, 2, 0, 1, 2, 3, 1, 0, 3, 2, 1, 0, 3, 1, 0, + 2, 1, 3, 2, + ], + }, + { + name: "Mar", + contributions: [ + 0, 2, 3, 1, 0, 2, 3, 0, 1, 2, 3, 1, 0, 2, 0, 1, 3, 2, 1, 0, 1, 3, 0, 2, + 1, 3, 0, 1, 2, 3, 1, + ], + }, + { + name: "Apr", + contributions: [ + 0, 1, 3, 0, 2, 1, 3, 0, 2, 1, 3, 0, 1, 2, 3, 1, 0, 2, 3, 0, 1, 2, 3, 0, + 2, 1, 3, 1, 0, 2, + ], + }, + { + name: "May", + contributions: [ + 3, 1, 0, 2, 1, 3, 0, 2, 3, 1, 0, 3, 2, 1, 3, 0, 2, 3, 0, 1, 2, 3, 1, 0, + 3, 2, 1, 0, 3, 1, 2, + ], + }, + ]; + + // Map contribution count to intensity classes + const getIntensityClass = (count) => { + if (count === 0) return "bg-gray-200"; // No contributions + if (count === 1) return "bg-gray-400"; // Low contributions + if (count === 2) return "bg-gray-600"; // Medium contributions + if (count >= 3) return "bg-gray-800"; // High contributions + return "bg-gray-200"; // Default + }; + + return ( +
+ {/* Container for all months */} +
+ {months.map((month, index) => ( +
+ {/* Render grid of contributions */} +
+ {month.contributions.map((count, idx) => ( +
+ ))} +
+ {/* Month name */} + {month.name} +
+ ))} +
+
+ ); +}; + +export default ContributionGrid; diff --git a/src/pages/Profile/Profile.tsx b/src/pages/Profile/Profile.tsx new file mode 100644 index 0000000..cbe16b7 --- /dev/null +++ b/src/pages/Profile/Profile.tsx @@ -0,0 +1,36 @@ +import ChartComponent from "../../components/ChartComponent"; +import ContributionGrid from "../../components/ContributionGrid"; + +const Profile = () => { + return ( +
+
+
+
+
+ Profile +
+
+

Jatin Shimpi

+
+
+
+ +
+
+
+ +
+
+
+ other content +
+
+ ); +}; + +export default Profile;