@@ -11,6 +11,7 @@ interface PRDetails {
1111 mergedAt : string ;
1212 repoName : string ;
1313 number : number ;
14+ points : number ; // Now includes the points field
1415}
1516
1617interface Contributor {
@@ -40,6 +41,9 @@ export default function PRListModal({ contributor, isOpen, onClose }: PRListModa
4041 // Get filtered PRs instead of using contributor.prDetails
4142 const filteredPRs = getFilteredPRsForContributor ( contributor . username ) ;
4243
44+ // Calculate total points from filtered PRs
45+ const totalPoints = filteredPRs . reduce ( ( sum , pr ) => sum + pr . points , 0 ) ;
46+
4347 const formatDate = ( dateString : string ) => {
4448 const date = new Date ( dateString ) ;
4549 return date . toLocaleDateString ( 'en-US' , {
@@ -72,6 +76,14 @@ export default function PRListModal({ contributor, isOpen, onClose }: PRListModa
7276 }
7377 } ;
7478
79+ // Helper function to get badge color based on points
80+ const getPointsBadgeColor = ( points : number ) => {
81+ if ( points >= 50 ) return '#10b981' ; // Green for Level 3
82+ if ( points >= 30 ) return '#f59e0b' ; // Orange for Level 2
83+ if ( points >= 10 ) return '#3b82f6' ; // Blue for Level 1
84+ return '#6b7280' ; // Gray for no points
85+ } ;
86+
7587 return (
7688 < AnimatePresence >
7789 { isOpen && (
@@ -107,8 +119,8 @@ export default function PRListModal({ contributor, isOpen, onClose }: PRListModa
107119 { contributor . username } 's Pull Requests
108120 </ h2 >
109121 < p className = { `pr-modal-subtitle ${ isDark ? "dark" : "light" } ` } >
110- { /*Show filtered count and add filter info */ }
111- { filteredPRs . length } merged PR{ filteredPRs . length !== 1 ? 's' : '' } • { filteredPRs . length * 10 } points
122+ { /* Show filtered count with actual total points */ }
123+ { filteredPRs . length } merged PR{ filteredPRs . length !== 1 ? 's' : '' } • { totalPoints } point { totalPoints !== 1 ? 's' : '' }
112124 { currentTimeFilter !== 'all' && (
113125 < span style = { { marginLeft : '8px' , opacity : 0.7 } } >
114126 ({ getFilterDisplayText ( currentTimeFilter ) } )
@@ -128,7 +140,7 @@ export default function PRListModal({ contributor, isOpen, onClose }: PRListModa
128140
129141 { /* Modal Body */ }
130142 < div className = { `pr-modal-body ${ isDark ? "dark" : "light" } ` } >
131- { /*Use filteredPRs instead of contributor.prDetails */ }
143+ { /* Use filteredPRs instead of contributor.prDetails */ }
132144 { filteredPRs && filteredPRs . length > 0 ? (
133145 < div className = "pr-list" >
134146 { filteredPRs . map ( ( pr , index ) => (
@@ -144,6 +156,23 @@ export default function PRListModal({ contributor, isOpen, onClose }: PRListModa
144156 { pr . title }
145157 </ h3 >
146158 < div className = "pr-item-actions" >
159+ { /* Points badge */ }
160+ { pr . points > 0 && (
161+ < span
162+ className = "pr-points-badge"
163+ style = { {
164+ backgroundColor : getPointsBadgeColor ( pr . points ) ,
165+ color : 'white' ,
166+ padding : '4px 8px' ,
167+ borderRadius : '12px' ,
168+ fontSize : '12px' ,
169+ fontWeight : '600' ,
170+ marginRight : '8px' ,
171+ } }
172+ >
173+ +{ pr . points } pts
174+ </ span >
175+ ) }
147176 < a
148177 href = { pr . url }
149178 target = "_blank"
0 commit comments