Skip to content

Commit

Permalink
fix(leaderboard):key-api-updated
Browse files Browse the repository at this point in the history
  • Loading branch information
AswinAsok committed Aug 24, 2023
1 parent eaef0b7 commit 9769672
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 28 deletions.
4 changes: 2 additions & 2 deletions src/Pages/Home/Home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ const Home = () => {
>
<button className={styles.primary}>Join Us</button>
</a>
<a
{/* <a
target="_blank"
rel="noopener noreferrer"
href="https://mulearn.org/journey"
>
<button className={styles.secondary}>Your Journey</button>
</a>
</a> */}
</div>
</div>
<img
Expand Down
52 changes: 29 additions & 23 deletions src/Pages/LeaderBoard/MonthlyLeaderboard/MonthlyLeaderboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const MonthlyLeaderboard = () => {

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);
Expand All @@ -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);
Expand Down Expand Up @@ -56,12 +56,14 @@ const MonthlyLeaderboard = () => {

<div className={styles.second_view_container}>
<div className={styles.second_view}>
<div className={styles.sv_texts}>
{" "}
<p className={styles.sv_heading}>
<span>Monthly College</span> Leader Board
</p>
</div>
{colleges && (
<div className={styles.sv_texts}>
{" "}
<p className={styles.sv_heading}>
<span>Monthly College</span> Leader Board
</p>
</div>
)}

<div className={styles.sv_cards_container}>
{colleges &&
Expand All @@ -74,11 +76,13 @@ const MonthlyLeaderboard = () => {
<p className={styles.card_code}>
College Code: {college.code}
</p>
<p className={styles.card_college}>{college.institution}</p>
<p className={styles.card_college}>
{college.institution}
</p>
<p className={styles.total_karma}>
Monthly Karma Points: {college.totalKarma}
Monthly Karma Points: {college.total_karma}
</p>
<br/>
<br />
</div>
);
})}
Expand All @@ -88,32 +92,34 @@ const MonthlyLeaderboard = () => {

<div className={styles.second_view_container}>
<div className={styles.second_view}>
<div className={styles.sv_texts}>
{" "}
<p className={styles.sv_heading}>
<span>Monthly Students</span> Leader Board
</p>
</div>
{students && (
<div className={styles.sv_texts}>
{" "}
<p className={styles.sv_heading}>
<span>Monthly Students</span> Leader Board
</p>
</div>
)}

<div className={styles.sv_cards_container}>
{students &&
students.map((student, position) => {
return (
<div className={styles.sv_card} >
<div className={styles.sv_card}>
<p className={styles.card_position}>
{position + 1} <span>Position</span>
</p>
<p className={styles.card_code}>
{/* <p className={styles.card_code}>
College Code: {student.institution}
</p>
<p className={styles.card_college}>{student.fullName}</p>
</p> */}
<p className={styles.card_college}>{student.full_name}</p>
<p className={styles.total_karma}>
Monthly Karma Points: {student.totalKarma}
Monthly Karma Points: {student.total_karma}
</p>
<p className={styles.total_karma}>
{/* Overall Karma Points: {student.totalKarma} */}
</p>
<br/>
<br />
</div>
);
})}
Expand Down
6 changes: 3 additions & 3 deletions src/Pages/LeaderBoard/leaderBoard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const LeaderBoard = () => {
</p>
<p className={styles.card_college}>{college.institution}</p>
<p className={styles.total_karma}>
Karma Points: {college.totalKarma}
Karma Points: {college.total_karma}
</p>
{/* <p className={styles.card_membercount}>
Total Members: {college.member_count}
Expand Down Expand Up @@ -110,9 +110,9 @@ const LeaderBoard = () => {
<p className={styles.card_code}>
College Code: {student.institution}
</p>
<p className={styles.card_college}>{student.fullName}</p>
<p className={styles.card_college}>{student.full_name}</p>
<p className={styles.total_karma}>
Karma Points: {student.totalKarma}
Karma Points: {student.total_karma}
</p>
</div>
);
Expand Down

0 comments on commit 9769672

Please sign in to comment.