@@ -154,12 +154,8 @@ <h2>Hall of Fame 🏆</h2>
154154 // Simulated data fetch function
155155 function fetchData ( ) {
156156 // Simulating an API call with setTimeout
157- setTimeout ( ( ) => {
158- const leaderboardData = [
159- { rank : 1 , projectName : "Disco Data Dancer 💃" , stars : 250 , cicdStatus : true } ,
160- { rank : 2 , projectName : "Chai Machine Learning 🍵" , stars : 210 , cicdStatus : true } ,
161- { rank : 3 , projectName : "Bollywood Backend Beats 🎵" , stars : 180 , cicdStatus : false }
162- ] ;
157+ setTimeout ( async ( ) => {
158+ const leaderboardData = await fetch ( './data/leaderboard.json' ) . then ( res => res . json ( ) ) ;
163159
164160 const hallOfFameData = [
165161 { month : "January" , year : 2024 , projectName : "Masala Code Machine 🌶️" } ,
@@ -169,12 +165,15 @@ <h2>Hall of Fame 🏆</h2>
169165 // Populate leaderboard
170166 const leaderboardBody = document . getElementById ( 'leaderboardBody' ) ;
171167 leaderboardData . forEach ( entry => {
168+ if ( ! entry . rank ) return ;
169+ const badge = "https://github.com/javanile/hackathon/actions/workflows/@francescobianco@matrix-theme.yml/badge.svg"
170+ const status = "https://github.com/javanile/hackathon/actions/workflows/@francescobianco@matrix-theme.yml"
172171 const row = `
173172 <tr>
174173 <td>${ entry . rank } </td>
175- <td>${ entry . projectName } </td>
174+ <td><a href="https://github.com/ ${ entry . project } " target="_blank"> ${ entry . project } </td>
176175 <td>${ entry . stars } </td>
177- <td>${ entry . cicdStatus ? '✅ Passed' : '❌ Not Passed' } </td>
176+ <td><a href=" ${ status } " target="_blank"><img src=" ${ badge } "></a> </td>
178177 </tr>
179178 ` ;
180179 leaderboardBody . innerHTML += row ;
0 commit comments