Skip to content

Commit 8f7eb2c

Browse files
temp for dhruv
1 parent 04a26a1 commit 8f7eb2c

12 files changed

Lines changed: 65 additions & 597 deletions

File tree

apps/blade/src/app/_components/dashboard/hackathon-dashboard/components.tsx

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
import type { SelectHackathon } from "@forge/db/schemas/knight-hacks";
2-
import { HACKATHONS } from "@forge/consts";
32

43
import type { api as serverCall } from "~/trpc/server";
54
import { HackerAppCard } from "~/app/_components/option-cards";
65
import { BaseHackathonCountdown } from "./countdown";
76
import { BaseHackathonData } from "./hackathon-data";
8-
import { BaseHackathonTeamPoints } from "./team-points";
97
import { BaseHackathonUpcomingEvents } from "./upcoming-events";
108

119
export {
@@ -15,31 +13,11 @@ export {
1513
} from "./hackathon-data";
1614
export { BaseHackathonCountdown } from "./countdown";
1715
export * from "./issue-dialog";
18-
export { BaseHackathonPointLeaderboard } from "./point-leaderboard";
19-
export { BaseHackathonTeamPoints } from "./team-points";
2016
export { BaseHackathonUpcomingEvents } from "./upcoming-events";
2117

2218
const DEFAULT_HACKER_GUIDE_HREF =
2319
"https://knight-hacks.notion.site/knight-hacks-viii";
2420

25-
const DEFAULT_CLASS_INFO = HACKATHONS.KNIGHT_HACKS_8.HACKER_CLASS_INFO;
26-
27-
export function BaseHackathonClassError() {
28-
return (
29-
<div className="flex flex-col items-center justify-center gap-y-6 px-4 py-12 text-center">
30-
<div className="rounded-lg border border-red-200 bg-red-50 p-6 dark:border-red-900 dark:bg-red-950">
31-
<h3 className="mb-2 text-xl font-semibold text-red-800 dark:text-red-200">
32-
Configuration Error
33-
</h3>
34-
<p className="text-red-700 dark:text-red-300">
35-
Unable to load your team information. Please contact support or try
36-
refreshing the page.
37-
</p>
38-
</div>
39-
</div>
40-
);
41-
}
42-
4321
export function BaseHackathonRegistrationPrompt({
4422
hackathon,
4523
}: {
@@ -58,7 +36,6 @@ export function BaseHackathonRegistrationPrompt({
5836
}
5937

6038
export function BaseHackathonDashboard({
61-
classInfoByClass = DEFAULT_CLASS_INFO,
6239
guideHref = DEFAULT_HACKER_GUIDE_HREF,
6340
hackathon,
6441
hacker,
@@ -79,28 +56,13 @@ export function BaseHackathonDashboard({
7956
return <BaseHackathonRegistrationPrompt hackathon={hackathon} />;
8057
}
8158

82-
if (!hacker.class || !(hacker.class in classInfoByClass)) {
83-
return <BaseHackathonClassError />;
84-
}
85-
86-
const classInfo = classInfoByClass[hacker.class];
87-
88-
if (!classInfo) {
89-
return <BaseHackathonClassError />;
90-
}
91-
92-
const { classPfp, team, teamColor } = classInfo;
93-
9459
return (
9560
<>
9661
<div className="animate-mobile-initial-expand mx-auto flex min-h-[900px] rounded-lg bg-[#E5E7EB] px-2 py-4 dark:bg-[#0A0F1D] sm:relative sm:px-0 sm:py-6 lg:min-h-[380px]">
9762
<BaseHackathonData
98-
classPfp={classPfp}
9963
data={hacker}
10064
guideHref={guideHref}
10165
hackathon={hackathon}
102-
team={team}
103-
teamColor={teamColor}
10466
/>
10567

10668
<div className="border-b-solid border-l-solid absolute bottom-0 right-0 hidden h-0 w-0 border-b-[30px] border-l-[30px] border-b-background border-l-transparent sm:block"></div>
@@ -123,9 +85,6 @@ export function BaseHackathonDashboard({
12385

12486
<div className="absolute -left-3 top-0 hidden h-full w-[0.4rem] bg-primary sm:block"></div>
12587
</div>
126-
<div className="animate-fade-in mb-8 mt-8 px-0 sm:mt-12 sm:px-4">
127-
<BaseHackathonTeamPoints hClass={hacker.class} hId={hackathon.name} />
128-
</div>
12988
<div className="animate-fade-in mb-8 mt-8 px-0 sm:mt-12 sm:px-4">
13089
<BaseHackathonCountdown endDate={hackathon.endDate} />
13190
</div>

apps/blade/src/app/_components/dashboard/hackathon-dashboard/hackathon-dashboard.tsx

Lines changed: 0 additions & 35 deletions
This file was deleted.

apps/blade/src/app/_components/dashboard/hackathon-dashboard/hackathon-data.tsx

Lines changed: 13 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,18 @@
11
"use client";
22

33
import { useEffect, useState } from "react";
4-
import Image from "next/image";
54
import Link from "next/link";
65
import { BookOpen, CircleCheckBig, Trophy } from "lucide-react";
76

87
import type { SelectHackathon } from "@forge/db/schemas/knight-hacks";
9-
import {
10-
Dialog,
11-
DialogContent,
12-
DialogHeader,
13-
DialogTitle,
14-
DialogTrigger,
15-
} from "@forge/ui/dialog";
8+
import { Dialog, DialogTrigger } from "@forge/ui/dialog";
169

1710
import type { api as serverCall } from "~/trpc/server";
1811
import { HackerQRCodePopup } from "~/app/_components/dashboard/hacker-dashboard/hacker-qr-button";
1912
import { DownloadQRPass } from "~/app/_components/dashboard/member-dashboard/download-qr-pass";
2013
import { HACKER_STATUS_MAP } from "~/consts";
2114
import { api } from "~/trpc/react";
2215
import { BaseHackathonIssueButton } from "./issue-dialog";
23-
import { BaseHackathonPointLeaderboard } from "./point-leaderboard";
2416

2517
type StatusKey = keyof typeof HACKER_STATUS_MAP | null | undefined;
2618
type HackerProfile = Awaited<
@@ -55,16 +47,10 @@ export function BaseHackathonData({
5547
data,
5648
guideHref,
5749
hackathon,
58-
teamColor,
59-
team,
60-
classPfp,
6150
}: {
6251
data: HackerProfile;
6352
guideHref: string;
6453
hackathon: SelectHackathon;
65-
teamColor: string;
66-
team: string;
67-
classPfp: string;
6854
}) {
6955
const [hackerStatus, setHackerStatus] = useState<string | null>("");
7056
const [hackerStatusColor, setHackerStatusColor] = useState<string>("");
@@ -117,32 +103,10 @@ export function BaseHackathonData({
117103
</h1>
118104
)}
119105

120-
<div className="animate-fade-in flex flex-wrap items-center justify-center gap-2 text-base text-muted-foreground sm:text-base md:justify-start">
121-
<span
122-
className="font-medium"
123-
style={{
124-
color: teamColor,
125-
textShadow: `0 0 10px ${teamColor}, 0 0 20px ${teamColor}`,
126-
}}
127-
>
128-
{hacker?.class}
129-
</span>
130-
<span className="text-border"></span>
131-
<span
132-
className="font-semibold text-foreground"
133-
style={{
134-
color: teamColor,
135-
textShadow: `0 0 10px ${teamColor}, 0 0 20px ${teamColor}`,
136-
}}
137-
>
138-
{"Team " + team}
139-
</span>
140-
</div>
141-
142106
{/* Status Badge */}
143107
<div className="animate-fade-in flex flex-col items-center space-y-3 md:items-start md:justify-start">
144108
<p className="text-center text-xs font-semibold uppercase tracking-wider text-muted-foreground sm:text-[10px] md:text-start">
145-
Status for {hackathon.displayName}
109+
Application Status
146110
</p>
147111
<div className="inline-flex items-center gap-2.5 rounded-full bg-background shadow-sm">
148112
<span
@@ -158,18 +122,6 @@ export function BaseHackathonData({
158122
</div>
159123
</div>
160124
</div>
161-
162-
{/* TK Image */}
163-
<div className="animate-fade-in relative h-28 w-28 flex-shrink-0 self-center overflow-hidden shadow-sm sm:h-32 sm:w-32 sm:self-start">
164-
<Image
165-
src={classPfp}
166-
alt="Team Mascot Image"
167-
fill
168-
className="rounded-full object-cover"
169-
priority
170-
sizes="(max-width: 800px) 112px, 128px"
171-
/>
172-
</div>
173125
</div>
174126
</div>
175127

@@ -200,19 +152,19 @@ export function BaseHackathonData({
200152
{/* Decorative gradient overlay */}
201153
<div
202154
className="absolute right-0 top-0 h-24 w-24 -translate-y-8 translate-x-8 rounded-full blur-3xl sm:h-32 sm:w-32 sm:-translate-y-10 sm:translate-x-10"
203-
style={{ backgroundColor: `${teamColor}20` }}
155+
style={{ backgroundColor: `primary` }}
204156
/>
205157

206158
<div className="relative">
207159
{/* Icon */}
208160
<div className="mb-2 flex justify-center sm:mb-3">
209161
<div
210162
className="rounded-full p-2 sm:p-2.5"
211-
style={{ backgroundColor: `${teamColor}20` }}
163+
style={{ backgroundColor: `primary` }}
212164
>
213165
<Trophy
214166
className="h-6 w-6 sm:h-7 sm:w-7"
215-
style={{ color: teamColor }}
167+
style={{ color: "primary" }}
216168
/>
217169
</div>
218170
</div>
@@ -231,15 +183,15 @@ export function BaseHackathonData({
231183
<div
232184
className="rounded-xl px-4 py-3 sm:px-6 sm:py-5"
233185
style={{
234-
background: `linear-gradient(to bottom right, ${teamColor}33, ${teamColor}0d)`,
235-
boxShadow: `0 0 20px ${teamColor}40`,
186+
background: `linear-gradient(to bottom right, primary, primary)`,
187+
boxShadow: `0 0 20px primary`,
236188
}}
237189
>
238190
<div
239191
className="text-center text-4xl font-bold tabular-nums tracking-tight sm:text-6xl"
240192
style={{
241-
color: teamColor,
242-
textShadow: `0 0 10px ${teamColor}80`,
193+
color: "primary",
194+
textShadow: `0 0 10px primary`,
243195
}}
244196
>
245197
{hacker?.points || 0}
@@ -251,28 +203,19 @@ export function BaseHackathonData({
251203
<button
252204
className="w-full rounded-lg py-2 text-sm font-semibold transition-all hover:shadow-md sm:py-2.5"
253205
style={{
254-
backgroundColor: `${teamColor}20`,
255-
color: teamColor,
206+
backgroundColor: `primary`,
207+
color: "secondary",
256208
}}
257209
onMouseEnter={(e) => {
258-
e.currentTarget.style.backgroundColor = `${teamColor}33`;
210+
e.currentTarget.style.backgroundColor = `primary`;
259211
}}
260212
onMouseLeave={(e) => {
261-
e.currentTarget.style.backgroundColor = `${teamColor}20`;
213+
e.currentTarget.style.backgroundColor = `primary`;
262214
}}
263215
>
264216
View Leaderboard
265217
</button>
266218
</DialogTrigger>
267-
<DialogContent>
268-
<DialogHeader>
269-
<DialogTitle>Leaderboard</DialogTitle>
270-
</DialogHeader>
271-
<BaseHackathonPointLeaderboard
272-
hacker={hacker}
273-
hId={hackathon.name}
274-
/>
275-
</DialogContent>
276219
</Dialog>
277220
</div>
278221
</div>

0 commit comments

Comments
 (0)