Skip to content

Commit e9438f3

Browse files
authored
Merge pull request #335 from HackDavis/feat/updated-dashboard
Feat/updated dashboard
2 parents e2cf72d + 2f098c5 commit e9438f3

File tree

7 files changed

+135
-139
lines changed

7 files changed

+135
-139
lines changed

app/(pages)/admin/_components/RankTeams/RankTeamsUI.tsx

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -395,17 +395,19 @@ export default function RankTeamsUI() {
395395
className="w-full"
396396
onValueChange={(value) => setActiveTrack(value)}
397397
>
398-
<TabsList className="flex overflow-x-auto gap-2 mb-4">
399-
{trackNames.map((trackName) => (
400-
<TabsTrigger
401-
key={trackName}
402-
value={trackName}
403-
className="px-3 py-2"
404-
>
405-
{trackName}
406-
</TabsTrigger>
407-
))}
408-
</TabsList>
398+
<div className="overflow-x-auto -mx-6 px-6">
399+
<TabsList className="flex w-max gap-2 h-auto min-h-[3rem] p-4 bg-muted rounded-lg">
400+
{trackNames.map((trackName) => (
401+
<TabsTrigger
402+
key={trackName}
403+
value={trackName}
404+
className="px-4 py-3 whitespace-nowrap flex-shrink-0 min-w-fit text-sm font-medium rounded-md"
405+
>
406+
{trackName}
407+
</TabsTrigger>
408+
))}
409+
</TabsList>
410+
</div>
409411

410412
{trackNames.map((trackName) => (
411413
<TabsContent key={trackName} value={trackName} className="space-y-4">
@@ -427,9 +429,9 @@ export default function RankTeamsUI() {
427429
return (
428430
<div
429431
key={result.team.team_id}
430-
className="flex items-start gap-4 p-4 border rounded-lg"
432+
className="flex items-start gap-4 p-4 border rounded-lg hover:shadow-md transition-shadow"
431433
>
432-
<div className="flex-shrink-0 w-8 h-8 bg-blue-100 text-blue-800 font-bold rounded-full flex items-center justify-center">
434+
<div className="flex-shrink-0 w-10 h-10 bg-blue-100 text-blue-800 font-bold rounded-full flex items-center justify-center text-lg">
433435
{index + 1}
434436
</div>
435437
<div className="flex-grow">
@@ -448,7 +450,10 @@ export default function RankTeamsUI() {
448450
)}
449451
</div>
450452
<div className="flex flex-col items-end gap-1">
451-
<Badge variant="secondary">
453+
<Badge
454+
variant="secondary"
455+
className="text-lg px-3 py-1"
456+
>
452457
Score: {result.team.final_score.toFixed(2)}
453458
</Badge>
454459
<Badge variant="outline" className="text-xs">
@@ -461,20 +466,20 @@ export default function RankTeamsUI() {
461466
</div>
462467

463468
{questions.length > 0 && (
464-
<div className="mt-3">
465-
<p className="text-sm font-medium text-gray-700">
469+
<div className="mt-4">
470+
<p className="text-sm font-medium text-gray-700 mb-2">
466471
Question Scores:
467472
</p>
468473
<div className="mt-2 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-2">
469474
{questions.map((question) => (
470475
<div
471476
key={question}
472-
className="text-sm p-2 bg-gray-50 rounded flex justify-between"
477+
className="text-sm p-3 bg-gray-50 rounded-lg flex justify-between items-center"
473478
>
474479
<span className="font-medium">
475480
{question}:
476481
</span>
477-
<span>
482+
<span className="font-bold text-blue-600">
478483
{questionScores[question] || 0}
479484
</span>
480485
</div>
@@ -484,17 +489,19 @@ export default function RankTeamsUI() {
484489
)}
485490

486491
{result.team.comments.length > 0 && (
487-
<div className="mt-3">
488-
<p className="text-sm font-medium text-gray-700">
492+
<div className="mt-4">
493+
<p className="text-sm font-medium text-gray-700 mb-2">
489494
Judge Comments:
490495
</p>
491496
<ul className="mt-2 space-y-2">
492497
{result.team.comments.map((comment, i) => (
493498
<li
494499
key={i}
495-
className="text-sm p-2 bg-gray-50 rounded"
500+
className="text-sm p-3 bg-blue-50 rounded-lg border-l-4 border-blue-200"
496501
>
497-
"{comment}"
502+
<span className="italic">
503+
"{comment}"
504+
</span>
498505
</li>
499506
))}
500507
</ul>
@@ -505,7 +512,7 @@ export default function RankTeamsUI() {
505512
);
506513
})
507514
) : (
508-
<p className="text-gray-500">
515+
<p className="text-gray-500 text-center py-8">
509516
No teams ranked for this track yet.
510517
</p>
511518
)}

app/(pages)/admin/dashboard/page.tsx

Lines changed: 0 additions & 90 deletions
This file was deleted.
File renamed without changes.

app/(pages)/admin/page.tsx

Lines changed: 92 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,98 @@
1+
'use client';
2+
import styles from './page.module.scss';
3+
14
import Link from 'next/link';
5+
import JudgingProgress from './_components/JudgingProgress/JudgingProgress';
6+
7+
const action_links = [
8+
{
9+
href: '/admin/csv',
10+
body: 'Import Teams with CSV',
11+
},
12+
{
13+
href: '/admin/match',
14+
body: 'Assign Judges to Teams',
15+
},
16+
{
17+
href: '/admin/score',
18+
body: 'Score and Shortlist',
19+
},
20+
{
21+
href: '/admin/panels',
22+
body: 'Create Panels',
23+
},
24+
{
25+
href: '/admin/invite-link',
26+
body: 'Invite Judges',
27+
},
28+
{
29+
href: '/admin/randomize-projects',
30+
body: 'Randomize Projects',
31+
},
32+
{
33+
href: '/admin/announcements',
34+
body: 'Announcements',
35+
},
36+
];
37+
38+
const data_links = [
39+
{
40+
href: '/admin/teams',
41+
body: 'View Teams',
42+
},
43+
{
44+
href: '/admin/judges',
45+
body: 'View Judges',
46+
},
47+
{
48+
href: '/admin/rollouts',
49+
body: 'View Rollouts',
50+
},
51+
];
252

3-
export default function Admin() {
53+
export default function Dashboard() {
454
return (
5-
<div style={{ display: 'flex', flexDirection: 'column', gap: '16px' }}>
6-
<Link href="/admin/dashboard">Dashboard</Link>
7-
<Link href="/admin/csv">Import Teams with CSV</Link>
8-
<Link href="/admin/match">Group Judges and Teams</Link>
9-
<Link href="/admin/panels">Create Panels</Link>
10-
<Link href="/admin/invite-link">Invite Users</Link>
11-
<Link href="/admin/score">Score and Shortlist</Link>
12-
<Link href="/admin/randomize-projects">Randomize Projects</Link>
13-
<Link href="/admin/announcements">Announcements</Link>
14-
<Link href="/admin/rollouts">Rollouts</Link>
15-
<Link href="/admin/judges">View Judges</Link>
16-
<Link href="/admin/teams">View Teams</Link>
55+
<div className={styles.page_container}>
56+
<div className={styles.dashboard_container}>
57+
<div className={styles.overview_container}>
58+
<div className={styles.navigation}>
59+
<h2>Navigation</h2>
60+
<div className={styles.navigation_flex}>
61+
<div className={styles.action_links}>
62+
{action_links.map(({ href, body }) => (
63+
<Link
64+
key={JSON.stringify({ href, body })}
65+
href={href}
66+
className={styles.action_link}
67+
>
68+
{body}
69+
</Link>
70+
))}
71+
</div>
72+
<div className={styles.data_links}>
73+
{data_links.map(({ href, body }) => (
74+
<Link
75+
key={JSON.stringify({ href, body })}
76+
href={href}
77+
className={styles.data_link}
78+
>
79+
{body}
80+
</Link>
81+
))}
82+
</div>
83+
</div>
84+
</div>
85+
<hr></hr>
86+
<h2>Overview</h2>
87+
<div className={styles.scoring_progress_container}>
88+
<JudgingProgress />
89+
</div>
90+
</div>
91+
<div className={styles.divider} />
92+
<div className={styles.problems_container}>
93+
<h2>Problems</h2>
94+
</div>
95+
</div>
1796
</div>
1897
);
1998
}

app/_data/tracks.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,6 @@ const nonHDTracks: Tracks = {
140140
};
141141

142142
const automaticTracks: Tracks = {
143-
'Best Hack for Social Good': {
144-
name: 'Best Hack for Social Good',
145-
filter: 'General',
146-
prizes: ['IPad', 'JBL Speaker'],
147-
images: [ipad, jblSpeaker],
148-
eligibility_criteria:
149-
'Encapsulate your authentic idea of "social good". All entries are automatically considered for this prize category.',
150-
},
151143
"Hacker's Choice Award": {
152144
name: "Hacker's Choice Award",
153145
filter: 'General',
@@ -159,6 +151,14 @@ const automaticTracks: Tracks = {
159151
};
160152

161153
const optedHDTracks: Tracks = {
154+
'Best Hack for Social Good': {
155+
name: 'Best Hack for Social Good',
156+
filter: 'General',
157+
prizes: ['IPad', 'JBL Speaker'],
158+
images: [ipad, jblSpeaker],
159+
eligibility_criteria:
160+
'Encapsulate your authentic idea of "social good". All entries are automatically considered for this prize category.',
161+
},
162162
'Most Technically Challenging Hack': {
163163
name: 'Most Technically Challenging Hack',
164164
filter: 'Technical',

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
"@mui/material": "^5.15.4",
2828
"@radix-ui/react-accordion": "^1.2.3",
2929
"@radix-ui/react-slot": "^1.1.2",
30-
"@szhsin/react-accordion": "^1.4.0",
31-
"@radix-ui/react-tooltip": "^1.1.8",
3230
"@radix-ui/react-tabs": "^1.1.3",
31+
"@radix-ui/react-tooltip": "^1.1.8",
32+
"@szhsin/react-accordion": "^1.4.0",
3333
"bcryptjs": "^2.4.3",
3434
"chart.js": "^4.4.9",
3535
"class-variance-authority": "^0.7.1",

0 commit comments

Comments
 (0)