Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leaderboard #61

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
937 changes: 456 additions & 481 deletions src/App.css

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const submitIdea = lazy(() =>
);
const Dash = lazy(() => import('./Components/iportal/startup/startup'));
const Error404 = lazy(() => import('./Components/err404'));
const LeaderBoard = lazy(() => import('./Components/LeaderBoard'));
const LeaderBoard = lazy(() => import('./Components/LeaderBoard/LeaderBoard'));
class App extends Component {
render() {
return (
Expand Down Expand Up @@ -97,8 +97,8 @@ class App extends Component {
<Route path="/internship/submit_idea/" component={submitIdea} />
<Route path="/internship/idea/" component={IportalStartup} />
<Route path="/leaderboard" component={LeaderBoard} />
<Route path="/" component={Error404} />
</Switch>
<Route path="/" component={Error404} />
</Switch>
</div>
</Suspense>
</BrowserRouter>
Expand Down
17 changes: 0 additions & 17 deletions src/Components/LeaderBoard/Card.jsx

This file was deleted.

14 changes: 0 additions & 14 deletions src/Components/LeaderBoard/Item.jsx

This file was deleted.

12 changes: 10 additions & 2 deletions src/Components/LeaderBoard/LeaderBoard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import React, { useEffect, useState } from 'react';
import axios from 'axios';
import Loader from '../api_loader/api_loader';
import './style.css';
import Card from './Card';
import Sidebar from '../Home/Sidebar/Sidebar';
import Footer from '../Footer/footer';

import Table from './Table';

const LeaderBoard = () => {
const [contributors, setContributors] = useState([]);
Expand Down Expand Up @@ -41,7 +43,13 @@ const LeaderBoard = () => {
<>
<div className="main">
<Sidebar />
<Card />
<div className="tableContainer">
<h1 className="text-center leader">Leaderboard</h1>
<div style={{ overflowX: 'auto', width: '100%' }}>
<Table data={contributors} />
</div>
</div>
<Footer />
</div>
</>
);
Expand Down
56 changes: 56 additions & 0 deletions src/Components/LeaderBoard/Table.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import React from 'react';

const Table = ({ data }) => {
console.log(data);
return (
<div>
<table className="mt-3 styled-table">
<tr>
<th>Rank</th>
<th>Username</th>
<th>Points</th>
<th>Hard Issues Solved</th>
<th>Medium Issues Solved</th>
<th>PR Opened</th>
<th>PR Merged</th>
<th>Good First Issue</th>
<th>Milestone Acheived</th>
</tr>
<tbody>
{data &&
data.map((el) => (
<tr>
<td>{el.rank}</td>
<td>{el.username}</td>
<td>{el.points}</td>
<td>{el.hard_issues_solved}</td>
<td>{el.medium_issues_solved}</td>
<td>{el.pr_opened}</td>
<td>{el.pr_merged}</td>
{el.good_first_issue ? (
<td>
<i className="fas fa-check-circle text-success"></i>
</td>
) : (
<td>
<i className="far fa-times-circle text-danger"></i>
</td>
)}
{el.milestone_acheived ? (
<td>
<i className="fas fa-check-circle text-success"></i>
</td>
) : (
<td>
<i className="far fa-times-circle text-danger"></i>
</td>
)}
</tr>
))}
</tbody>
</table>
</div>
);
};

export default Table;
Binary file added src/Components/LeaderBoard/bg.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 0 additions & 53 deletions src/Components/LeaderBoard/index.js

This file was deleted.

174 changes: 167 additions & 7 deletions src/Components/LeaderBoard/style.css
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500&display=swap');

.main {
background-color: darkblue;
height: 100vh;
background-color: #00012d;

font-family: 'Poppins';
}
/*
.cardContainer {
position: absolute;
top: 10%;
left: 50%;
transform: translate(-50%);
border-radius: 10px;
}
#card {
width: 400px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
background-color: #fff;
background-color: rgb(196, 196, 196);
border-radius: 10px;
padding-bottom: 10px;
}
.c_bg {
border-radius: 10px;
background-color: rgb(51, 43, 105);
height: 250px;
width: 100%;
Expand All @@ -27,13 +35,165 @@
color: #fff;
}

.cardContent {
height: 300px;
background-color: #fff;
.cardContent {
border-radius: 10px;
height: 400px;
background-color: rgb(196, 196, 196);
width: 100%;
overflow-y: scroll;
padding-left: 20px;
padding-right: 10px;
}
.top_list {
padding-left: 20px;
padding-right: 20px;
}
.item {
display: flex;
border-radius: 8px;
align-items: center;
justify-content: space-around;
margin-top: 8px;
margin-bottom: 8px;
background-color: rgb(240, 240, 240);
font-weight: bold;
box-shadow: 0px 1px 5px #333;
}

*/

/* .rank {
font-size: 20px;

padding-top: 6px;
padding-bottom: 6px;
}
.name {
font-size: 20px;
width: 230px;
text-align: center;
padding-top: 6px;
padding-bottom: 6px;
}
.points,
.hard,
.medium,
.pr_opened,
.pr_merged,
.goodFirst,
.milestone {
font-size: 20px;
width: auto;
text-align: center;
padding-top: 6px;
padding-bottom: 6px;
}

.item {
color: #000;
border: 1px solid green;
display: flex;
border: 2px solid #fff;
justify-content: space-around;
background-color: rgb(212, 212, 212);
margin-bottom: 10px;
}
.tableContainer {
position: relative;
top: 60px;
padding-left: 100px;
padding-right: 100px;
}
.leader {
color: aliceblue;
}
.legend {
display: flex;
color: #fff;
justify-content: space-between;
}
.legend > div {
border: 1px solid red;
width: 100px;
text-align: center;
} */
.leader {
color: #fff;
}
.leader::after {
content: '';
height: 2px;
display: block;
width: 150px;
background-color: #fff;
position: absolute;
left: 51%;
}
.tableContainer {
padding-left: 50px;
padding-right: 50px;
padding-top: 100px;
padding-bottom: 70px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
table {
color: #fff;
width: 100%;
}

table,
th {
border-collapse: collapse;
text-align: center;
padding: 10px;
font-size: 20px;
}
th {
background-color: rgb(0, 0, 0);
}
th tr {
box-shadow: 0 0 10px #333;
}
table i {
font-size: 25px;
}
table tbody tr {
box-shadow: 0 0 10px #333;
}

table tbody tr:nth-of-type(even) {
background-color: #333;
}
table tbody tr:nth-of-type(odd) {
background-color: #d6d6d6;
color: #333;
}
td {
padding: 10px;
}

@media only screen and (max-width: 768px) {
table,
th {
padding: 10px;
font-size: 16px;
}
.leader {
font-size: 30px;
}
.tableContainer {
padding-left: 10px;
padding-right: 10px;
}
.leader::after {
content: '';
height: 2px;
display: block;
width: 110px;
background-color: #fff;
position: absolute;
left: 51%;
}
}