Skip to content

Commit ec23fb5

Browse files
committed
feat: enhance contributors page UI and add footer navigation
1 parent 6c6bc3e commit ec23fb5

1 file changed

Lines changed: 254 additions & 98 deletions

File tree

Lines changed: 254 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
11
import { useEffect, useState } from "react";
2-
import {
3-
Container,
4-
Grid,
5-
Card,
6-
CardContent,
7-
Avatar,
8-
Typography,
9-
Button,
10-
Box,
11-
CircularProgress,
12-
Alert,
13-
} from "@mui/material";
14-
import { FaGithub } from "react-icons/fa";
15-
import { Link } from "react-router-dom";
162
import axios from "axios";
3+
import {
4+
Sparkles,
5+
Github,
6+
Users,
7+
GitPullRequest,
8+
ArrowRight,
9+
} from "lucide-react";
1710
import { GITHUB_REPO_CONTRIBUTORS_URL } from "../../utils/constants";
1811

1912
interface Contributor {
@@ -24,21 +17,39 @@ interface Contributor {
2417
html_url: string;
2518
}
2619

20+
const stats = [
21+
{
22+
title: "Contributors",
23+
value: "30+",
24+
icon: Users,
25+
},
26+
{
27+
title: "Pull Requests",
28+
value: "250+",
29+
icon: GitPullRequest,
30+
},
31+
{
32+
title: "Open Source",
33+
value: "Community Driven",
34+
icon: Github,
35+
},
36+
];
37+
2738
const ContributorsPage = () => {
2839
const [contributors, setContributors] = useState<Contributor[]>([]);
2940
const [loading, setLoading] = useState<boolean>(true);
3041
const [error, setError] = useState<string | null>(null);
3142

32-
// Fetch contributors from GitHub API
3343
useEffect(() => {
3444
const fetchContributors = async () => {
3545
try {
36-
const response = await axios.get(GITHUB_REPO_CONTRIBUTORS_URL, {
37-
withCredentials: false,
38-
});
46+
const response = await axios.get(
47+
GITHUB_REPO_CONTRIBUTORS_URL
48+
);
49+
3950
setContributors(response.data);
4051
} catch {
41-
setError("Failed to fetch contributors. Please try again later.");
52+
setError("Failed to fetch contributors.");
4253
} finally {
4354
setLoading(false);
4455
}
@@ -49,96 +60,241 @@ const ContributorsPage = () => {
4960

5061
if (loading) {
5162
return (
52-
<Box sx={{ display: "flex", justifyContent: "center", mt: 4 }}>
53-
<CircularProgress />
54-
</Box>
63+
<div className="min-h-screen flex items-center justify-center bg-white dark:bg-slate-950">
64+
<div className="flex flex-col items-center gap-5">
65+
<div className="w-14 h-14 border-4 border-cyan-400 border-t-transparent rounded-full animate-spin"></div>
66+
<p className="text-slate-600 dark:text-slate-300">
67+
Loading Contributors...
68+
</p>
69+
</div>
70+
</div>
5571
);
5672
}
5773

5874
if (error) {
5975
return (
60-
<Box sx={{ mt: 4 }}>
61-
<Alert severity="error">{error}</Alert>
62-
</Box>
76+
<div className="min-h-screen flex items-center justify-center bg-white dark:bg-slate-950">
77+
<div className="px-6 py-4 rounded-2xl border border-red-500/30 bg-red-500/10 text-red-500">
78+
{error}
79+
</div>
80+
</div>
6381
);
6482
}
6583

6684
return (
67-
<div className="bg-white dark:bg-gray-900 text-black dark:text-white min-h-screen p-4 mt-4">
68-
<Container>
69-
<Typography sx={{ pb: 2 }} variant="h4" align="center" gutterBottom>
70-
🤝 Contributors
71-
</Typography>
72-
73-
<Grid container spacing={4}>
74-
{contributors.map((contributor) => (
75-
<Grid item xs={12} sm={6} md={3} key={contributor.id}>
76-
<Card
77-
sx={{
78-
textAlign: "center",
79-
p: 2,
80-
borderRadius: "10px",
81-
border: "1px solid #E0E0E0",
82-
boxShadow: "0 4px 10px rgba(0,0,0,0.1)",
83-
transition: "transform 0.3s ease-in-out",
84-
"&:hover": {
85-
transform: "scale(1.05)",
86-
boxShadow: "0 8px 15px rgba(0,0,0,0.2)",
87-
borderColor: "#C0C0C0",
88-
outlineColor: "#B3B3B3",
89-
},
90-
}}
91-
>
92-
<Link
93-
to={`/contributor/${contributor.login}`}
94-
style={{ textDecoration: "none" }}
95-
>
96-
<Avatar
97-
src={contributor.avatar_url}
98-
alt={contributor.login}
99-
sx={{ width: 100, height: 100, mx: "auto", mb: 2 }}
85+
<div className="relative w-screen min-h-screen overflow-x-hidden bg-white dark:bg-slate-950 text-slate-900 dark:text-white transition-colors duration-300">
86+
87+
{/* BACKGROUND GLOWS */}
88+
<div className="absolute top-0 left-0 w-72 h-72 bg-blue-500/10 dark:bg-blue-500/20 blur-3xl rounded-full" />
89+
<div className="absolute bottom-0 right-0 w-96 h-96 bg-cyan-400/10 dark:bg-cyan-500/10 blur-3xl rounded-full" />
90+
91+
{/* GRID OVERLAY */}
92+
<div className="absolute inset-0 bg-[linear-gradient(to_right,#e2e8f015_1px,transparent_1px),linear-gradient(to_bottom,#e2e8f015_1px,transparent_1px)] dark:bg-[linear-gradient(to_right,#1f293710_1px,transparent_1px),linear-gradient(to_bottom,#1f293710_1px,transparent_1px)] bg-[size:4rem_4rem] pointer-events-none" />
93+
94+
<div className="relative z-10 w-screen min-h-screen px-6 py-20">
95+
96+
{/* HERO SECTION */}
97+
<section className="text-center mb-28 max-w-6xl mx-auto">
98+
99+
<div className="inline-flex items-center gap-2 px-4 py-2 rounded-full border border-blue-500/20 dark:border-blue-500/30 bg-blue-500/10 text-blue-700 dark:text-blue-300 text-sm mb-6 backdrop-blur-xl">
100+
<Sparkles className="w-4 h-4" />
101+
Open Source Community
102+
</div>
103+
104+
<h1 className="text-5xl md:text-7xl font-extrabold leading-tight mb-8 tracking-tight">
105+
Meet Our{" "}
106+
<span className="bg-gradient-to-r from-blue-600 via-cyan-500 to-teal-500 dark:from-blue-400 dark:via-cyan-400 dark:to-teal-400 bg-clip-text text-transparent [filter:drop-shadow(0_0_30px_rgba(56,189,248,0.3))]">
107+
Amazing Contributors
108+
</span>
109+
</h1>
110+
111+
<p className="max-w-3xl mx-auto text-slate-600 dark:text-slate-300 text-lg md:text-xl leading-relaxed">
112+
These amazing developers are helping build and improve GitHub Tracker through open-source collaboration and innovation.
113+
</p>
114+
</section>
115+
116+
{/* STATS */}
117+
<section className="max-w-7xl mx-auto grid grid-cols-1 md:grid-cols-3 gap-6 mb-28">
118+
119+
{stats.map((stat) => {
120+
const Icon = stat.icon;
121+
122+
return (
123+
<div
124+
key={stat.title}
125+
className="
126+
p-8
127+
rounded-3xl
128+
border
129+
border-slate-200
130+
dark:border-slate-800
131+
bg-slate-100/80
132+
dark:bg-white/5
133+
backdrop-blur-xl
134+
text-center
135+
hover:border-blue-500/50
136+
dark:hover:border-cyan-400/60
137+
hover:-translate-y-2
138+
hover:shadow-lg
139+
hover:shadow-blue-500/10
140+
dark:hover:shadow-cyan-500/20
141+
transition-all
142+
duration-300
143+
"
144+
>
145+
<div className="w-12 h-12 mx-auto rounded-2xl bg-blue-500/10 border border-blue-500/20 flex items-center justify-center mb-5">
146+
<Icon className="w-7 h-7 text-blue-500 dark:text-cyan-300" />
147+
</div>
148+
149+
<h3 className="text-4xl font-bold mb-2">
150+
{stat.title === "Contributors"
151+
? `${contributors.length}+`
152+
: stat.value}
153+
</h3>
154+
155+
<p className="text-slate-600 dark:text-slate-400">
156+
{stat.title}
157+
</p>
158+
</div>
159+
);
160+
})}
161+
</section>
162+
163+
{/* CONTRIBUTORS SECTION */}
164+
<section className="max-w-7xl mx-auto mb-28">
165+
166+
<div className="text-center mb-14">
167+
<h2 className="text-4xl md:text-5xl font-bold mb-5">
168+
Community Contributors
169+
</h2>
170+
171+
<p className="text-slate-500 dark:text-slate-400 max-w-2xl mx-auto text-lg">
172+
The incredible developers helping GitHub Tracker grow through collaboration, innovation, and open-source contributions.
173+
</p>
174+
</div>
175+
176+
<div className="grid sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-8">
177+
178+
{contributors.map((contributor) => (
179+
<a
180+
key={contributor.id}
181+
href={contributor.html_url}
182+
target="_blank"
183+
rel="noopener noreferrer"
184+
className="
185+
group
186+
relative
187+
overflow-hidden
188+
p-6
189+
rounded-3xl
190+
border
191+
border-slate-200
192+
dark:border-slate-800
193+
bg-slate-100/80
194+
dark:bg-white/5
195+
backdrop-blur-xl
196+
hover:border-blue-500/50
197+
dark:hover:border-cyan-400/60
198+
hover:-translate-y-2
199+
hover:shadow-lg
200+
hover:shadow-blue-500/10
201+
dark:hover:shadow-cyan-500/20
202+
transition-all
203+
duration-300
204+
"
205+
>
206+
207+
{/* GLOW */}
208+
<div className="absolute inset-0 opacity-0 group-hover:opacity-100 transition-opacity duration-300 bg-[radial-gradient(circle_at_top_right,rgba(59,130,246,0.12),transparent_40%)] dark:bg-[radial-gradient(circle_at_top_right,rgba(34,211,238,0.15),transparent_40%)]" />
209+
210+
<div className="relative z-10 flex flex-col items-center text-center">
211+
212+
{/* AVATAR */}
213+
<div className="relative mb-6">
214+
215+
<div className="absolute inset-0 rounded-full bg-gradient-to-r from-blue-500 to-cyan-500 blur-xl opacity-0 group-hover:opacity-40 transition-opacity duration-300" />
216+
217+
<img
218+
src={contributor.avatar_url}
219+
alt={contributor.login}
220+
className="
221+
relative
222+
w-24
223+
h-24
224+
rounded-full
225+
border-4
226+
border-slate-200
227+
dark:border-slate-700
228+
group-hover:border-blue-500/50
229+
dark:group-hover:border-cyan-400/60
230+
transition-all
231+
duration-300
232+
"
100233
/>
101-
<CardContent>
102-
<Typography variant="h6" sx={{ fontWeight: "bold" }}>
103-
{contributor.login}
104-
</Typography>
105-
106-
<Typography variant="body2" color="text.secondary">
107-
{contributor.contributions} Contributions
108-
</Typography>
109-
{/*
110-
<Typography variant="body2" sx={{ mt: 2 }}>
111-
Thank you for your valuable contributions to our
112-
community!
113-
</Typography> */}
114-
</CardContent>
115-
</Link>
116-
117-
<Box sx={{ mt: 2 }}>
118-
<Button
119-
variant="contained"
120-
startIcon={<FaGithub />}
121-
href={contributor.html_url}
122-
target="_blank"
123-
sx={{
124-
backgroundColor: "#333333",
125-
textTransform: "none",
126-
color: "#FFFFFF",
127-
"&:hover": {
128-
backgroundColor: "#555555",
129-
},
130-
}}
131-
>
132-
GitHub
133-
</Button>
134-
</Box>
135-
</Card>
136-
</Grid>
137-
))}
138-
</Grid>
139-
</Container>
234+
</div>
235+
236+
<h3 className="text-xl font-bold mb-1">
237+
{contributor.login}
238+
</h3>
239+
240+
<p className="text-slate-500 dark:text-slate-400 mb-4 text-sm">
241+
{contributor.contributions} contributions
242+
</p>
243+
244+
<div className="inline-flex px-3 py-1.5 rounded-full bg-blue-500/10 border border-blue-500/20 text-sm text-blue-700 dark:text-cyan-300 mb-6">
245+
Contributor
246+
</div>
247+
248+
<div className="inline-flex items-center gap-2 px-4 py-2.5 rounded-xl bg-slate-900 dark:bg-white text-white dark:text-slate-950 font-medium hover:scale-105 transition-all duration-300">
249+
<Github className="w-4 h-4" />
250+
View GitHub
251+
</div>
252+
253+
</div>
254+
</a>
255+
))}
256+
</div>
257+
</section>
258+
259+
{/* CTA SECTION */}
260+
<section className="max-w-6xl mx-auto text-center">
261+
262+
<div className="relative overflow-hidden p-10 rounded-3xl border border-blue-200 dark:border-blue-500/20 bg-gradient-to-br from-blue-100/70 to-cyan-100/70 dark:from-blue-500/10 dark:to-cyan-500/10 backdrop-blur-xl shadow-sm dark:shadow-none">
263+
264+
<div className="absolute inset-0 bg-[radial-gradient(circle_at_top_right,rgba(59,130,246,0.12),transparent_40%)] dark:bg-[radial-gradient(circle_at_top_right,rgba(34,211,238,0.15),transparent_40%)]" />
265+
266+
<div className="relative z-10">
267+
268+
<div className="inline-flex items-center gap-2 px-4 py-2 rounded-full bg-blue-500/10 border border-blue-500/20 text-blue-700 dark:text-blue-300 text-sm mb-6">
269+
<Sparkles className="w-4 h-4" />
270+
Join the Community
271+
</div>
272+
273+
<h2 className="text-4xl font-bold mb-5">
274+
Want to Contribute?
275+
</h2>
276+
277+
<p className="text-slate-700 dark:text-slate-300 text-lg leading-relaxed max-w-3xl mx-auto mb-8">
278+
Help improve GitHub Tracker, contribute new features, fix bugs, and become part of our growing open-source community.
279+
</p>
280+
281+
<a
282+
href="https://github.com/GitMetricsLab/github_tracker"
283+
target="_blank"
284+
rel="noopener noreferrer"
285+
className="inline-flex items-center gap-2 px-7 py-4 rounded-xl bg-gradient-to-r from-blue-500 to-cyan-500 hover:scale-105 transition-all duration-300 font-semibold text-white shadow-lg shadow-blue-500/20"
286+
>
287+
Start Contributing
288+
<ArrowRight className="w-5 h-5" />
289+
</a>
290+
291+
</div>
292+
</div>
293+
</section>
294+
295+
</div>
140296
</div>
141297
);
142298
};
143299

144-
export default ContributorsPage;
300+
export default ContributorsPage;

0 commit comments

Comments
 (0)