From e537a95f804765f33ff072309d03e0529ed0cd27 Mon Sep 17 00:00:00 2001 From: aamoghS Date: Fri, 6 Feb 2026 19:42:41 -0500 Subject: [PATCH] redo some ui oops --- sites/mainweb/app/(portal)/judge/page.tsx | 36 ++------- .../components/portal/judge/RubricSlider.tsx | 77 +++++++++++++------ 2 files changed, 62 insertions(+), 51 deletions(-) diff --git a/sites/mainweb/app/(portal)/judge/page.tsx b/sites/mainweb/app/(portal)/judge/page.tsx index 13bab53..8944aca 100644 --- a/sites/mainweb/app/(portal)/judge/page.tsx +++ b/sites/mainweb/app/(portal)/judge/page.tsx @@ -1,13 +1,12 @@ 'use client'; import { useState, useEffect } from 'react'; -import { useSession, signOut } from 'next-auth/react'; +import { useSession } from 'next-auth/react'; import { trpc } from '@/lib/trpc'; import { useRouter } from 'next/navigation'; -import { LiquidGlass } from '@/components/portal/LiquidGlass'; import { LoadingScreen } from '@/components/portal/LoadingScreen'; import { StatusScreen } from '@/components/portal/StatusScreen'; -import { RubricSlider } from '@/components/portal/judge/RubricSlider'; +import { RubricSlider, RubricSliderStyles } from '@/components/portal/judge/RubricSlider'; // Rubric criteria definitions const RUBRIC_CRITERIA = [ @@ -130,9 +129,6 @@ export default function JudgePage() { variant="denied" title="Not a Judge" message="You're not registered as a judge." - onAction={() => signOut({ callbackUrl: '/login' })} - actionLabel="Sign Out" - actionVariant="danger" /> ); } @@ -143,9 +139,6 @@ export default function JudgePage() { variant="waiting" title="No Assignment" message="Please wait for event assignment." - onAction={() => signOut({ callbackUrl: '/login' })} - actionLabel="Sign Out" - actionVariant="default" /> ); } @@ -159,9 +152,6 @@ export default function JudgePage() { variant="success" title="All Done!" message="You've judged all projects. Thank you!" - onAction={() => signOut({ callbackUrl: '/login' })} - actionLabel="Sign Out" - actionVariant="primary" /> ); } @@ -182,7 +172,7 @@ export default function JudgePage() { /> -
+
{/* Progress text */}

{((progress?.completed || 0) + 1)} of {progress?.total} @@ -211,13 +201,6 @@ export default function JudgePage() { > Start Judging - -

); @@ -270,7 +253,7 @@ export default function JudgePage() { )} - {/* Rubric Scoring */} + {/* Rubric Scoring - Sliders */}
{RUBRIC_CRITERIA.map((criterion) => ( {submit.isPending ? 'Submitting...' : 'Submit & Next'} - -
+ + ); } diff --git a/sites/mainweb/components/portal/judge/RubricSlider.tsx b/sites/mainweb/components/portal/judge/RubricSlider.tsx index 067329a..3321407 100644 --- a/sites/mainweb/components/portal/judge/RubricSlider.tsx +++ b/sites/mainweb/components/portal/judge/RubricSlider.tsx @@ -7,8 +7,6 @@ interface RubricSliderProps { description: string; value: number; onChange: (value: number) => void; - isExpanded?: boolean; - onToggleExpand?: () => void; } export function RubricSlider({ @@ -18,7 +16,7 @@ export function RubricSlider({ onChange, }: RubricSliderProps) { return ( -
+
{/* Label and current score */}
@@ -30,29 +28,64 @@ export function RubricSlider({
- {/* Button-based scoring - much better for mobile */} -
- {[1, 2, 3, 4, 5, 6, 7, 8, 9, 10].map((num) => ( - - ))} + {/* Slider - Large touch target */} +
+ onChange(parseInt(e.target.value))} + className="w-full h-14 appearance-none bg-transparent cursor-pointer touch-pan-y rubric-slider" + style={{ + background: `linear-gradient(to right, #00A8A8 0%, #00A8A8 ${(value - 1) * 11.11}%, rgba(255,255,255,0.1) ${(value - 1) * 11.11}%, rgba(255,255,255,0.1) 100%)`, + borderRadius: '12px', + }} + /> +
+ 1 + 5 + 10 +
); } -// Keep for backward compatibility but no longer needed +// Slider styles for the page export function RubricSliderStyles() { - return null; + return ( + + ); }