Skip to content

Commit 1c8da25

Browse files
chore: changed scoring criterion
(only on the UI, still still request is getting sent)
1 parent 628bd87 commit 1c8da25

2 files changed

Lines changed: 33 additions & 30 deletions

File tree

src/app/team/[id]/page.tsx

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ type ApiError = {
3434
message: string;
3535
};
3636

37-
3837
function ScoreSection({ teamId }: { teamId: string }) {
3938
const [design, setDesign] = useState(0);
4039
const [implementation, setImplementation] = useState(0);
@@ -44,7 +43,7 @@ function ScoreSection({ teamId }: { teamId: string }) {
4443
const [comment, setComment] = useState("");
4544
const [editMode, setEditMode] = useState(false);
4645
const [currentScoreId, setCurrentScoreId] = useState<string | null>(null);
47-
46+
4847
const queryClient = useQueryClient();
4948
const { create } = useToast();
5049
const {
@@ -59,9 +58,9 @@ function ScoreSection({ teamId }: { teamId: string }) {
5958
staleTime: 0,
6059
});
6160
const [round, setRound] = useState(scores.length);
62-
useEffect(()=> {
63-
setRound(scores.length)
64-
}, [scores])
61+
useEffect(() => {
62+
setRound(scores.length);
63+
}, [scores]);
6564
const createScoreMutation = useMutation({
6665
mutationFn: ({
6766
teamId,
@@ -258,15 +257,15 @@ function ScoreSection({ teamId }: { teamId: string }) {
258257
<div className="mt-8">
259258
<h2 className="mb-4 text-xl font-bold">Team Scores</h2>
260259

261-
{ (
260+
{
262261
<div className="mb-4 space-y-4 rounded-lg bg-gray-900 p-4">
263262
<h3 className="text-lg font-semibold">
264263
{editMode ? "Edit Score" : "Add Score"}
265-
<p className="text-red-500 text-sm">score can range from 0-10</p>
264+
<p className="text-sm text-red-500">score can range from 0-10</p>
266265
</h3>
267266
<div className="grid grid-cols-2 gap-4">
268267
<div className="space-y-2">
269-
<Label>Design</Label>
268+
<Label>UI & Design</Label>
270269
<Input
271270
type="number"
272271
min="0"
@@ -276,7 +275,7 @@ function ScoreSection({ teamId }: { teamId: string }) {
276275
/>
277276
</div>
278277
<div className="space-y-2">
279-
<Label>Implementation</Label>
278+
<Label>Technical Implementation</Label>
280279
<Input
281280
type="number"
282281
min="0"
@@ -286,7 +285,7 @@ function ScoreSection({ teamId }: { teamId: string }) {
286285
/>
287286
</div>
288287
<div className="space-y-2">
289-
<Label>Presentation</Label>
288+
<Label>Presentation & Communication</Label>
290289
<Input
291290
type="number"
292291
min="0"
@@ -296,7 +295,7 @@ function ScoreSection({ teamId }: { teamId: string }) {
296295
/>
297296
</div>
298297
<div className="space-y-2">
299-
<Label>Innovation</Label>
298+
<Label>Innovation & Creativity</Label>
300299
<Input
301300
type="number"
302301
min="0"
@@ -305,7 +304,7 @@ function ScoreSection({ teamId }: { teamId: string }) {
305304
onChange={(e) => setInnovation(Number(e.target.value))}
306305
/>
307306
</div>
308-
<div className="space-y-2">
307+
{/* <div className="space-y-2">
309308
<Label>Teamwork</Label>
310309
<Input
311310
type="number"
@@ -314,15 +313,15 @@ function ScoreSection({ teamId }: { teamId: string }) {
314313
value={teamwork}
315314
onChange={(e) => setTeamwork(Number(e.target.value))}
316315
/>
317-
</div>
316+
</div> */}
318317
<div className="space-y-2">
319318
<Label>Round</Label>
320319
<Input
321320
type="number"
322321
min="0"
323322
disabled
324323
max="10"
325-
value={scores.length }
324+
value={scores.length}
326325
// onChange={(e) => setRound(Number(e.target.value))}
327326
/>
328327
</div>
@@ -359,7 +358,7 @@ function ScoreSection({ teamId }: { teamId: string }) {
359358
)}
360359
</div>
361360
</div>
362-
)}
361+
}
363362

364363
{scores &&
365364
scores.length > 0 &&
@@ -374,7 +373,7 @@ function ScoreSection({ teamId }: { teamId: string }) {
374373
Total Score: {calculateTotalScore(score)}
375374
</div>
376375
<div className="space-x-2">
377-
{/*
376+
{/*
378377
<Button
379378
size="sm"
380379
variant="destructive"
@@ -385,11 +384,11 @@ function ScoreSection({ teamId }: { teamId: string }) {
385384
</div>
386385
</div>
387386
<div className="grid grid-cols-3 gap-4">
388-
<div>Design: {score.design}</div>
389-
<div>Implementation: {score.implementation}</div>
390-
<div>Presentation: {score.presentation}</div>
391-
<div>Innovation: {score.innovation}</div>
392-
<div>Teamwork: {score.teamwork}</div>
387+
<div>UI & Design : {score.design}</div>
388+
<div>Technical Implementation : {score.implementation}</div>
389+
<div>Presentation & Communication: {score.presentation}</div>
390+
<div>Innovation & Creativity : {score.innovation}</div>
391+
{/* <div>Teamwork: {score.teamwork}</div> */}
393392
<div>Round: {score.round}</div>
394393
</div>
395394
{score.comment && (
@@ -477,9 +476,13 @@ export default function TheTeam() {
477476
return (
478477
<>
479478
<div className="mx-auto w-[100%] space-y-4">
480-
<Button variant="outline" size="icon" onClick={()=>{
481-
router.push("/teams")
482-
}}>
479+
<Button
480+
variant="outline"
481+
size="icon"
482+
onClick={() => {
483+
router.push("/teams");
484+
}}
485+
>
483486
<ChevronLeft />
484487
</Button>
485488
{id && <ScoreSection teamId={String(id)} />}

src/components/ViewScores.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,28 +60,28 @@ export default function ViewScores({ row }: { row: Row<Leaderboard> }) {
6060
<div className="flex items-center gap-2">
6161
<Brush className="h-4 w-4 text-purple-500" />
6262
<Label className="font-semibold">
63-
Design: {design}
63+
UI & Design : {design}
6464
</Label>
6565
</div>
6666
<div className="flex items-center gap-2">
6767
<Code className="h-4 w-4 text-green-500" />
6868
<Label className="font-semibold">
69-
Implementation: {implementation}
69+
Technical Implementation : {implementation}
7070
</Label>
7171
</div>
7272
<div className="flex items-center gap-2">
7373
<Trophy className="h-4 w-4 text-yellow-500" />
7474
<Label className="font-semibold">
75-
Innovation: {innovation}
75+
Innovation & Creativity: {innovation}
7676
</Label>
7777
</div>
7878
<div className="flex items-center gap-2">
7979
<Presentation className="h-4 w-4 text-red-500" />
8080
<Label className="font-semibold">
81-
Presentation: {presentation}
81+
Presentation & Communication: {presentation}
8282
</Label>
8383
</div>
84-
<div className="flex items-center gap-2">
84+
{/* <div className="flex items-center gap-2">
8585
<Users className="h-4 w-4 text-blue-700" />
8686
<Label className="font-semibold">
8787
Teamwork: {teamwork}
@@ -92,7 +92,7 @@ export default function ViewScores({ row }: { row: Row<Leaderboard> }) {
9292
<Label className="text-lg font-semibold">
9393
Total Score: {round_total}
9494
</Label>
95-
</div>
95+
</div> */}
9696
</div>
9797
</div>
9898
);

0 commit comments

Comments
 (0)