Skip to content

Commit 31e1229

Browse files
committed
Contributors section fixed
1 parent d026431 commit 31e1229

4 files changed

Lines changed: 50 additions & 5 deletions

File tree

frontend/src/components/Footer.jsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,23 @@ function Footer() {
101101
</div>
102102
</div>
103103

104+
{/* Contributors - dedicated section */}
105+
<div className="footer-section">
106+
<h3 className="text-lg font-semibold text-gray-900 dark:text-white mb-6 flex items-center gap-2">
107+
<FaCheckCircle className="text-cyan-400" />
108+
Contributors
109+
</h3>
110+
<p className="text-sm text-gray-600 dark:text-gray-400 mb-4">Meet the people who help build Riveto.</p>
111+
<ul className="space-y-3">
112+
<li>
113+
<Link to="/contributors" className="text-sm text-gray-600 dark:text-gray-400 hover:text-cyan-400 transition-colors duration-300 flex items-center gap-2 group">
114+
<span className="w-1 h-1 bg-cyan-500 rounded-full opacity-0 group-hover:opacity-100 transition-opacity"></span>
115+
View Contributors
116+
</Link>
117+
</li>
118+
</ul>
119+
</div>
120+
104121
{/* Quick Links */}
105122
<div className="footer-section">
106123
<h3 className="text-lg font-semibold text-gray-900 dark:text-white mb-6 flex items-center gap-2">

frontend/src/components/Nav.jsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { IoSearchCircleOutline, IoSearchCircleSharp } from "react-icons/io5";
44
import { FaUserCircle } from "react-icons/fa";
55
import { MdOutlineShoppingCart, MdLogout } from "react-icons/md";
66
import { IoMdHome } from "react-icons/io";
7-
import { HiOutlineCollection, HiOutlineUserGroup } from "react-icons/hi";
7+
import { HiOutlineCollection } from "react-icons/hi";
88
import { RiContactsLine } from "react-icons/ri";
99
import { BsMoon, BsSun, BsSearch, BsBoxSeam } from "react-icons/bs";
1010
import { FiInfo, FiUser, FiLogIn } from "react-icons/fi";
@@ -105,7 +105,7 @@ function Nav() {
105105

106106
{/* Desktop Navigation */}
107107
<nav ref={navRef} className="hidden md:flex gap-12 text-sm font-medium cursor-pointer">
108-
{['Home', 'Collection', 'Contributors', 'About', 'Contact'].map((item) => {
108+
{['Home', 'Collection', 'About', 'Contact'].map((item) => {
109109
const path = item.toLowerCase() === 'home' ? '/' : `/${item.toLowerCase()}`;
110110
const isActive = location.pathname === path;
111111
return (
@@ -300,11 +300,10 @@ function Nav() {
300300
)}
301301

302302
{/* Mobile Bottom Navigation */}
303-
<div className="fixed bottom-0 left-0 w-full md:hidden h-16 bg-white dark:bg-[#121826] border-t border-gray-200 dark:border-gray-800 flex items-center justify-around z-40 shadow-lg">
303+
<div className="fixed bottom-0 left-0 w-full md:hidden h-16 bg-white dark:bg-[#121826] border-t border-gray-200 dark:border-gray-800 flex items-center justify-around z-40 shadow-lg">
304304
{[
305305
{ icon: IoMdHome, label: "Home", path: "/" },
306306
{ icon: HiOutlineCollection, label: "Collection", path: "/collection" },
307-
{ icon: HiOutlineUserGroup, label: "Contributors", path: "/contributors" },
308307
{ icon: RiContactsLine, label: "Contact", path: "/contact" },
309308
].map((item, index) => {
310309
const isActive = location.pathname === item.path;
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"contributors": [
3+
{ "id": 1, "login": "madhav2348", "avatar_url": "https://github.com/madhav2348.png", "contributions": 124, "html_url": "https://github.com/madhav2348" },
4+
{ "id": 2, "login": "asadanwarr0", "avatar_url": "https://github.com/asadanwarr0.png", "contributions": 98, "html_url": "https://github.com/asadanwarr0" },
5+
{ "id": 3, "login": "vedantbudhaware", "avatar_url": "https://github.com/vedantbudhaware.png", "contributions": 76, "html_url": "https://github.com/vedantbudhaware" },
6+
{ "id": 4, "login": "alice", "avatar_url": "https://github.com/alice.png", "contributions": 45, "html_url": "https://github.com/alice" },
7+
{ "id": 5, "login": "bob", "avatar_url": "https://github.com/bob.png", "contributions": 32, "html_url": "https://github.com/bob" },
8+
{ "id": 6, "login": "carol", "avatar_url": "https://github.com/carol.png", "contributions": 21, "html_url": "https://github.com/carol" }
9+
],
10+
"stats": {
11+
"stars": 123,
12+
"forks": 45,
13+
"totalContributors": 6,
14+
"pullRequests": 78
15+
}
16+
}

frontend/src/hooks/useGitHubContributors.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { useState, useEffect } from 'react';
22
import axios from 'axios';
3+
import fallback from '../data/contributorsFallback.json';
34

45
const useGitHubContributors = (repoOwner = 'Nsanjayboruds', repoName = 'RIVETO') => {
56
const [contributors, setContributors] = useState([]);
@@ -41,7 +42,19 @@ const useGitHubContributors = (repoOwner = 'Nsanjayboruds', repoName = 'RIVETO')
4142
setError(null);
4243
} catch (err) {
4344
console.error("Error fetching GitHub data:", err);
44-
setError("Failed to load contributor data. Please try again later.");
45+
// Use local fallback data so the page still renders nicely
46+
try {
47+
setContributors(fallback.contributors || []);
48+
setStats(fallback.stats || {
49+
stars: 0,
50+
forks: 0,
51+
totalContributors: fallback.contributors ? fallback.contributors.length : 0,
52+
pullRequests: 0,
53+
});
54+
setError(null);
55+
} catch (e) {
56+
setError("Failed to load contributor data. Please try again later.");
57+
}
4558
} finally {
4659
setLoading(false);
4760
}

0 commit comments

Comments
 (0)