Skip to content

Commit e1d1e83

Browse files
authored
HMT-116/nav bar for judge page (#190)
1 parent 91f6c4d commit e1d1e83

File tree

6 files changed

+127
-1
lines changed

6 files changed

+127
-1
lines changed
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { NavBar } from "@/components/judging/Navbar";
2+
3+
const AssignedTeamsPage = () => {
4+
const assignedTeams = [
5+
{ id: 1, name: "Team Alpha" },
6+
{ id: 2, name: "Team Beta" },
7+
{ id: 3, name: "Team Gamma" },
8+
];
9+
10+
return (
11+
<div>
12+
<NavBar />
13+
<h1> Put assinged teams here Assigned Teams</h1>
14+
<ul>
15+
{assignedTeams.map((team) => (
16+
<li key={team.id}>{team.name}</li>
17+
))}
18+
</ul>
19+
</div>
20+
);
21+
};
22+
23+
export default AssignedTeamsPage;

src/app/judging/page.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import type { Metadata } from "next";
22

3+
import { NavBar } from "@/components/judging/Navbar";
4+
35
import JudgingDashboard from "./JudgingDashboard";
46

57
export const dynamic = "force-dynamic";
@@ -20,6 +22,7 @@ export const metadata: Metadata = {
2022
export default function Judging() {
2123
return (
2224
<main className="flex w-full flex-1 flex-col gap-4 bg-dashboard-grey">
25+
<NavBar />
2326
<JudgingDashboard />
2427
</main>
2528
);

src/app/judging/rubric/page.tsx

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { NavBar } from "@/components/judging/Navbar";
2+
3+
const RubricPage = () => {
4+
return (
5+
<div>
6+
<NavBar />
7+
<h1>Judging Rubric here</h1>
8+
<ul></ul>
9+
</div>
10+
);
11+
};
12+
13+
export default RubricPage;

src/app/judging/schedule/page.tsx

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
"use client";
2+
3+
import { useEffect, useState } from "react";
4+
5+
interface Schedule {
6+
teamName: string;
7+
timeSlot: string;
8+
}
9+
10+
const SchedulePage = () => {
11+
const [schedule, setSchedule] = useState<Schedule[]>([]);
12+
13+
useEffect(() => {
14+
// Fetch schedule data from an API or define it statically
15+
// Template for when we will fetch the schedule
16+
const fetchSchedule = async () => {
17+
const response = await fetch("/api/schedule");
18+
const data = await response.json();
19+
setSchedule(data);
20+
};
21+
22+
fetchSchedule();
23+
}, []);
24+
25+
return (
26+
<div>
27+
<h1>Judging Schedule</h1>
28+
<table>
29+
<thead>
30+
<tr>
31+
<th>Team Name</th>
32+
<th>Time Slot</th>
33+
</tr>
34+
</thead>
35+
<tbody>
36+
{schedule.map((item, index) => (
37+
<tr key={index}>
38+
<td>{item.teamName}</td>
39+
<td>{item.timeSlot}</td>
40+
</tr>
41+
))}
42+
</tbody>
43+
</table>
44+
</div>
45+
);
46+
};
47+
48+
export default SchedulePage;

src/components/Header.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export default function Header() {
6868
) : user.type === UserType.Admin ? (
6969
<Link href="/admin">Admin Dashboard</Link>
7070
) : user.type === UserType.Judge ? (
71-
<Link href="/judging">Judge Dashboard</Link>
71+
<Link href="/judging"></Link>
7272
) : null}
7373
</>
7474
) : (

src/components/judging/Navbar.tsx

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
"use client";
2+
3+
import Link from "next/link";
4+
5+
export function NavBar() {
6+
// Will add the actual routes when the pages are
7+
const navigation = [
8+
{
9+
name: "Dashboard",
10+
href: "/judging",
11+
},
12+
{
13+
name: "Schedule",
14+
href: "/judging/schedule",
15+
},
16+
{
17+
name: "Assigned Teams",
18+
href: "/judging/assigned-teams",
19+
},
20+
{
21+
name: "Rubric",
22+
href: "/judging/rubric",
23+
},
24+
];
25+
26+
return (
27+
<nav className="border-b bg-white text-awesomer-purple">
28+
<div className="mx-auto flex h-20 items-center justify-center space-x-48 pl-8">
29+
{navigation.map((item) => {
30+
return (
31+
<Link key={item.name} href={item.href} className="text-2xl">
32+
{item.name}
33+
</Link>
34+
);
35+
})}
36+
</div>
37+
</nav>
38+
);
39+
}

0 commit comments

Comments
 (0)