@@ -14,6 +14,7 @@ interface LeaderboardEntry {
1414 name : string ;
1515 points_details : PointsDetails [ ] ;
1616 total_points : number ;
17+ curr_sem_points : number ;
1718}
1819
1920const Modal : React . FC < { isOpen : boolean ; onClose : ( ) => void ; data : PointsDetails [ ] ; name : string } > = ( { isOpen, onClose, data, name } ) => {
@@ -70,7 +71,7 @@ const Leaderboard: React.FC = () => {
7071 useEffect ( ( ) => {
7172 const fetchData = async ( ) => {
7273 try {
73- const response = await fetch ( 'https ://api.thesoda.io /leaderboard' ) ;
74+ const response = await fetch ( 'http ://127.0.0.1:8000 /leaderboard' ) ;
7475 if ( ! response . ok ) {
7576 throw new Error ( 'Network response was not ok' ) ;
7677 }
@@ -131,8 +132,9 @@ const Leaderboard: React.FC = () => {
131132 < table className = "table-auto border-collapse border border-zinc-700 w-full text-center" >
132133 < thead >
133134 < tr className = "bg-zinc-800" >
134- < th className = "w-1/2 border border-zinc-700 py-2 px-4 text-base sm:text-lg font-semibold text-center" > Name</ th >
135- < th className = "w-1/2 border border-zinc-700 py-2 px-4 text-base sm:text-lg font-semibold text-center" > Points Earned</ th >
135+ < th className = "w-1/3 border border-zinc-700 py-2 px-4 text-base sm:text-lg font-semibold text-center" > Name</ th >
136+ < th className = "w-1/3 border border-zinc-700 py-2 px-4 text-base sm:text-lg font-semibold text-center" > Points Earned this Semester</ th >
137+ < th className = "w-1/3 border border-zinc-700 py-2 px-4 text-base sm:text-lg font-semibold text-center" > All-time Points</ th >
136138 </ tr >
137139 </ thead >
138140 < tbody >
@@ -143,6 +145,7 @@ const Leaderboard: React.FC = () => {
143145 className = "hover:bg-soda-blue/5 transition-colors cursor-pointer"
144146 >
145147 < td className = "border border-zinc-700 py-2 px-4 text-center" > { entry . name } </ td >
148+ < td className = "border border-zinc-700 py-2 px-4 text-center" > { entry . curr_sem_points } </ td >
146149 < td className = "border border-zinc-700 py-2 px-4 text-center" > { entry . total_points } </ td >
147150 </ tr >
148151 ) ) }
0 commit comments