Hide jury stat card in header for non-jury rounds (INTAKE, FILTERING, etc.)
Build and Push Docker Image / build (push) Failing after 8s
Details
Build and Push Docker Image / build (push) Failing after 8s
Details
The jury selector card in the stats bar was still visible on round types where juries don't apply. Now conditionally rendered based on hasJury, with the grid adjusting from 4 to 3 columns accordingly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
09049d2911
commit
f731f96a0a
|
|
@ -582,7 +582,7 @@ export default function RoundDetailPage() {
|
||||||
</motion.div>
|
</motion.div>
|
||||||
|
|
||||||
{/* ===== STATS BAR — Accent-bordered cards ===== */}
|
{/* ===== STATS BAR — Accent-bordered cards ===== */}
|
||||||
<div className="grid gap-3 grid-cols-2 sm:grid-cols-4">
|
<div className={cn("grid gap-3 grid-cols-2", hasJury ? "sm:grid-cols-4" : "sm:grid-cols-3")}>
|
||||||
{/* Projects */}
|
{/* Projects */}
|
||||||
<AnimatedCard index={0}>
|
<AnimatedCard index={0}>
|
||||||
<Card className="border-l-4 border-l-[#557f8c] hover:shadow-md transition-shadow">
|
<Card className="border-l-4 border-l-[#557f8c] hover:shadow-md transition-shadow">
|
||||||
|
|
@ -605,56 +605,58 @@ export default function RoundDetailPage() {
|
||||||
</Card>
|
</Card>
|
||||||
</AnimatedCard>
|
</AnimatedCard>
|
||||||
|
|
||||||
{/* Jury (with inline group selector) */}
|
{/* Jury (with inline group selector) — only for jury-relevant rounds */}
|
||||||
<AnimatedCard index={1}>
|
{hasJury && (
|
||||||
<Card className="border-l-4 border-l-purple-500 hover:shadow-md transition-shadow">
|
<AnimatedCard index={1}>
|
||||||
<CardContent className="pt-4 pb-3">
|
<Card className="border-l-4 border-l-purple-500 hover:shadow-md transition-shadow">
|
||||||
<div className="flex items-center gap-2.5 mb-1" data-jury-select>
|
<CardContent className="pt-4 pb-3">
|
||||||
<div className="rounded-full bg-purple-50 p-1.5">
|
<div className="flex items-center gap-2.5 mb-1" data-jury-select>
|
||||||
<Users className="h-4 w-4 text-purple-500" />
|
<div className="rounded-full bg-purple-50 p-1.5">
|
||||||
|
<Users className="h-4 w-4 text-purple-500" />
|
||||||
|
</div>
|
||||||
|
<span className="text-sm font-medium text-muted-foreground">Jury</span>
|
||||||
</div>
|
</div>
|
||||||
<span className="text-sm font-medium text-muted-foreground">Jury</span>
|
{juryGroups && juryGroups.length > 0 ? (
|
||||||
</div>
|
<Select
|
||||||
{juryGroups && juryGroups.length > 0 ? (
|
value={round.juryGroupId ?? '__none__'}
|
||||||
<Select
|
onValueChange={(value) => {
|
||||||
value={round.juryGroupId ?? '__none__'}
|
assignJuryMutation.mutate({
|
||||||
onValueChange={(value) => {
|
id: roundId,
|
||||||
assignJuryMutation.mutate({
|
juryGroupId: value === '__none__' ? null : value,
|
||||||
id: roundId,
|
})
|
||||||
juryGroupId: value === '__none__' ? null : value,
|
}}
|
||||||
})
|
disabled={assignJuryMutation.isPending}
|
||||||
}}
|
>
|
||||||
disabled={assignJuryMutation.isPending}
|
<SelectTrigger className="h-8 text-xs mt-1">
|
||||||
>
|
<SelectValue placeholder="Select jury group..." />
|
||||||
<SelectTrigger className="h-8 text-xs mt-1">
|
</SelectTrigger>
|
||||||
<SelectValue placeholder="Select jury group..." />
|
<SelectContent>
|
||||||
</SelectTrigger>
|
<SelectItem value="__none__">No jury assigned</SelectItem>
|
||||||
<SelectContent>
|
{juryGroups.map((jg: any) => (
|
||||||
<SelectItem value="__none__">No jury assigned</SelectItem>
|
<SelectItem key={jg.id} value={jg.id}>
|
||||||
{juryGroups.map((jg: any) => (
|
{jg.name} ({jg._count?.members ?? 0} members)
|
||||||
<SelectItem key={jg.id} value={jg.id}>
|
</SelectItem>
|
||||||
{jg.name} ({jg._count?.members ?? 0} members)
|
))}
|
||||||
</SelectItem>
|
</SelectContent>
|
||||||
))}
|
</Select>
|
||||||
</SelectContent>
|
) : juryGroup ? (
|
||||||
</Select>
|
<>
|
||||||
) : juryGroup ? (
|
<p className="text-3xl font-bold mt-2">{juryMemberCount}</p>
|
||||||
<>
|
<p className="text-xs text-muted-foreground truncate">{juryGroup.name}</p>
|
||||||
<p className="text-3xl font-bold mt-2">{juryMemberCount}</p>
|
</>
|
||||||
<p className="text-xs text-muted-foreground truncate">{juryGroup.name}</p>
|
) : (
|
||||||
</>
|
<>
|
||||||
) : (
|
<p className="text-3xl font-bold mt-2 text-muted-foreground">—</p>
|
||||||
<>
|
<p className="text-xs text-muted-foreground">No jury groups yet</p>
|
||||||
<p className="text-3xl font-bold mt-2 text-muted-foreground">—</p>
|
</>
|
||||||
<p className="text-xs text-muted-foreground">No jury groups yet</p>
|
)}
|
||||||
</>
|
</CardContent>
|
||||||
)}
|
</Card>
|
||||||
</CardContent>
|
</AnimatedCard>
|
||||||
</Card>
|
)}
|
||||||
</AnimatedCard>
|
|
||||||
|
|
||||||
{/* Window */}
|
{/* Window */}
|
||||||
<AnimatedCard index={2}>
|
<AnimatedCard index={hasJury ? 2 : 1}>
|
||||||
<Card className="border-l-4 border-l-emerald-500 hover:shadow-md transition-shadow">
|
<Card className="border-l-4 border-l-emerald-500 hover:shadow-md transition-shadow">
|
||||||
<CardContent className="pt-4 pb-3">
|
<CardContent className="pt-4 pb-3">
|
||||||
<div className="flex items-center gap-2.5">
|
<div className="flex items-center gap-2.5">
|
||||||
|
|
@ -687,7 +689,7 @@ export default function RoundDetailPage() {
|
||||||
</AnimatedCard>
|
</AnimatedCard>
|
||||||
|
|
||||||
{/* Advancement */}
|
{/* Advancement */}
|
||||||
<AnimatedCard index={3}>
|
<AnimatedCard index={hasJury ? 3 : 2}>
|
||||||
<Card className="border-l-4 border-l-amber-500 hover:shadow-md transition-shadow">
|
<Card className="border-l-4 border-l-amber-500 hover:shadow-md transition-shadow">
|
||||||
<CardContent className="pt-4 pb-3">
|
<CardContent className="pt-4 pb-3">
|
||||||
<div className="flex items-center gap-2.5">
|
<div className="flex items-center gap-2.5">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue