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

Add MentorsStats page and route, and fix an error from compiler #227

Open
wants to merge 1 commit into
base: truth-redefined-again
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
3 changes: 3 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import PastProgramsPage from "./pages/PastProgramsPage";
import StudentDashboard from "./pages/StudentDashboard";
import RegistrationForm from "./pages/RegistrationForm";
import NotFoundPage from "./pages/404";
import MentorsStats from './pages/MentorsStats';

function App() {
return (
Expand Down Expand Up @@ -61,6 +62,8 @@ function App() {
path={ROUTER_PATHS.PASTPROGRAMS}
element={<PastProgramsPage />}
/>
<Route path={ROUTER_PATHS.ALl_MENTOR_STATS}
element={<MentorsStats />} />
<Route path="*" element={<NotFoundPage />} />
</Routes>
</AuthProvider>
Expand Down
33 changes: 33 additions & 0 deletions src/pages/MentorsStats.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
function MentorsStats() {
return (
<div className="flex flex-col items-center pt-28">
<h1 className="font-display text-6xl font-bold text-center mb-8 py-4">
Mentors Stats
</h1>
<table className='border'>
<tr className='border'>
<th>Mentor</th>
<th>Total PRs</th>
<th>Total Commits</th>
<th>Total Lines Changed</th>
<th>Total Projects</th>
</tr>
<tr>
<td>John Doe</td>
<td>5</td>
<td>10</td>
<td>100</td>
<td>2</td>
</tr>
<tr>
<td>Jane Doe</td>
<td>10</td>
<td>20</td>
<td>200</td>
<td>1</td>
</tr>
</table>
</div>
);
}
export default MentorsStats;
2 changes: 1 addition & 1 deletion src/util/backend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ async function makeBackendRequest(
endpoint: string,
method: AllowedBackendMethods,
jwt: string | null,
body: Object | null,
body: object | null,
): Promise<Response> {
const headers: {
"Content-Type"?: string;
Expand Down
1 change: 1 addition & 0 deletions src/util/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export enum ROUTER_PATHS {
// Stats routes
ALL_STUDENT_STATS = "/stats/students",
ALL_PROJECT_STATS = "/stats/projects",
ALl_MENTOR_STATS = "/stats/mentors",
ONE_STUDENT_STATS = "/stats/student/:id",
ONE_MENTOR_STATS = "/stats/mentor/:id",
ONE_PROJECT_STATS = "/stats/project/:id",
Expand Down