File tree 2 files changed +19
-9
lines changed
app/(authenticated)/prizes
2 files changed +19
-9
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,15 @@ export default async function Prizes() {
34
34
const achievements = await AchievementService . getAchievements ( ) ;
35
35
const cvPrizeUsers = achievements ?. find ( ( a ) => a . kind === "cv" ) ?. users ;
36
36
37
- return cvPrizeUsers ?. map ( ( u ) => ( { userId : u } ) ) || [ ] ;
37
+ return (
38
+ cvPrizeUsers ?. map ( ( u ) => ( {
39
+ userId : u ,
40
+ entries : achievements ?. reduce (
41
+ ( acc , a ) => ( a . users ?. includes ( u ) ? acc + a . value : acc ) ,
42
+ 0 ,
43
+ ) ,
44
+ } ) ) || [ ]
45
+ ) ;
38
46
}
39
47
40
48
return (
@@ -89,7 +97,7 @@ export default async function Prizes() {
89
97
< PrizeTile prize = { sessionPrize } />
90
98
< PrizeSessions
91
99
sessions = { sinfoSessions . filter ( ( s ) =>
92
- sessionPrize . sessions ?. includes ( s . id )
100
+ sessionPrize . sessions ?. includes ( s . id ) ,
93
101
) }
94
102
/>
95
103
</ div >
Original file line number Diff line number Diff line change @@ -75,13 +75,15 @@ export function PrizeTile({
75
75
numberOfPieces = { 500 }
76
76
recycle = { false }
77
77
/>
78
- < Image
79
- className = "w-32 h-32 object-contain"
80
- width = { 128 }
81
- height = { 128 }
82
- src = { winner . img }
83
- alt = { winner . name }
84
- />
78
+ < Link href = { `/users/${ winner . id } ` } >
79
+ < Image
80
+ className = "size-[128px] object-contain"
81
+ width = { 128 }
82
+ height = { 128 }
83
+ src = { winner . img }
84
+ alt = { winner . name }
85
+ />
86
+ </ Link >
85
87
< span className = "" > { winner . name } </ span >
86
88
< Link
87
89
className = "button button-primary text-sm w-full"
You can’t perform that action at this time.
0 commit comments