diff --git a/src/Pages/Home/Home.jsx b/src/Pages/Home/Home.jsx index 41608cb92..537242aad 100644 --- a/src/Pages/Home/Home.jsx +++ b/src/Pages/Home/Home.jsx @@ -35,13 +35,13 @@ const Home = () => { > - - + */} { useEffect(() => { axios - .get('https://mulearn.org/api/v1/leaderboard/college-monthly/') + .get("https://mulearn.org/api/v1/leaderboard/college-monthly/") .then(function (response) { // console.log(response.data.response); setColleges(response.data.response); @@ -21,7 +21,7 @@ const MonthlyLeaderboard = () => { }); axios - .get('https://mulearn.org/api/v1/leaderboard/students-monthly/') + .get("https://mulearn.org/api/v1/leaderboard/students-monthly/") .then(function (response) { // console.log(response.data.response); setStudents(response.data.response); @@ -56,12 +56,14 @@ const MonthlyLeaderboard = () => {
-
- {" "} -

- Monthly College Leader Board -

-
+ {colleges && ( +
+ {" "} +

+ Monthly College Leader Board +

+
+ )}
{colleges && @@ -74,11 +76,13 @@ const MonthlyLeaderboard = () => {

College Code: {college.code}

-

{college.institution}

+

+ {college.institution} +

- Monthly Karma Points: {college.totalKarma} + Monthly Karma Points: {college.total_karma}

-
+
); })} @@ -88,32 +92,34 @@ const MonthlyLeaderboard = () => {
-
- {" "} -

- Monthly Students Leader Board -

-
+ {students && ( +
+ {" "} +

+ Monthly Students Leader Board +

+
+ )}
{students && students.map((student, position) => { return ( -
+

{position + 1} Position

-

+ {/*

College Code: {student.institution} -

-

{student.fullName}

+

*/} +

{student.full_name}

- Monthly Karma Points: {student.totalKarma} + Monthly Karma Points: {student.total_karma}

{/* Overall Karma Points: {student.totalKarma} */}

-
+
); })} diff --git a/src/Pages/LeaderBoard/leaderBoard.jsx b/src/Pages/LeaderBoard/leaderBoard.jsx index f404ea411..812126b1f 100644 --- a/src/Pages/LeaderBoard/leaderBoard.jsx +++ b/src/Pages/LeaderBoard/leaderBoard.jsx @@ -78,7 +78,7 @@ const LeaderBoard = () => {

{college.institution}

- Karma Points: {college.totalKarma} + Karma Points: {college.total_karma}

{/*

Total Members: {college.member_count} @@ -110,9 +110,9 @@ const LeaderBoard = () => {

College Code: {student.institution}

-

{student.fullName}

+

{student.full_name}

- Karma Points: {student.totalKarma} + Karma Points: {student.total_karma}

);