@@ -9,11 +9,28 @@ import contributorList from "../projects/assets/contributors.json";
99import ContributorCount from "./components/ContributorCount" ;
1010import TopContributors from "./components/TopContributors" ;
1111
12+ interface Contributor {
13+ id : number ;
14+ contributions : number ;
15+ html_url : string ;
16+ avatar_url : string ;
17+ login : string ;
18+ lastActiveDays : number | null ;
19+ }
20+
1221const Contributors = ( ) => {
13- const contributorsArray = Object . values ( contributorList ) ;
22+ const contributorsArray = Object . values ( contributorList ) as Contributor [ ] ;
23+
24+ // Filter and sort contributors for top section (active in last 30 days)
25+ const activeTopContributors = [ ...contributorsArray ]
26+ . filter (
27+ ( contributor ) =>
28+ contributor . lastActiveDays === null || contributor . lastActiveDays <= 30
29+ )
30+ . sort ( ( a , b ) => b . contributions - a . contributions ) ;
1431
15- // Sort contributors by contributions for top contributors section
16- const sortedContributors = [ ...contributorsArray ] . sort (
32+ // Sort all contributors by contributions for the main grid
33+ const sortedAllContributors = [ ...contributorsArray ] . sort (
1734 ( a , b ) => b . contributions - a . contributions
1835 ) ;
1936
@@ -31,13 +48,13 @@ const Contributors = () => {
3148 { /* Top Contributors Section */ }
3249 < div className = 'mt-12 flex flex-col items-center justify-center' >
3350 < h2 className = 'text-2xl font-medium text-gray-800 mb-6' >
34- Top Contributors
51+ Top Active Contributors
3552 </ h2 >
3653 < p className = 'text-xl text-mf-light-grey tracking-wide mb-2' >
3754 Meet our top six contributors — the people who help turn ideas
3855 into impact.
3956 </ p >
40- < TopContributors contributors = { sortedContributors } />
57+ < TopContributors contributors = { activeTopContributors } />
4158 </ div >
4259
4360 { /* All Contributors Section */ }
@@ -46,12 +63,12 @@ const Contributors = () => {
4663 All Contributors
4764 </ h2 >
4865 < p className = 'text-xl text-mf-light-grey tracking-wide mb-10' >
49- We’ re a dynamic group of individuals who are passionate about what
50- we do.
66+ We' re a dynamic group of individuals who are passionate about
67+ what we do.
5168 </ p >
5269 { contributorsArray ? (
5370 < div className = 'grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4' >
54- { contributorsArray . map ( ( contributor ) => (
71+ { sortedAllContributors . map ( ( contributor ) => (
5572 < div
5673 key = { contributor . id }
5774 className = 'bg-white border border-gray-200 rounded-lg shadow-lg transition-transform duration-300 transform hover:scale-105'
0 commit comments