From d740d43800dc294dc21da8507e4512a5409c2d33 Mon Sep 17 00:00:00 2001 From: Z8MB1E Date: Wed, 26 Aug 2026 23:55:03 -0400 Subject: [PATCH] feat(eod): update difficulty selection in EOD components and bump version to 0.2.0 --- package.json | 2 +- src/components/frontend/eod/EodArena.tsx | 6 +++++- src/components/frontend/eod/EodLeaderboard.tsx | 8 ++++++-- src/components/frontend/eod/MinesweeperBoard.tsx | 5 ++++- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 86ecfe6..ceb5c00 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polaris-task-force", - "version": "0.1.6", + "version": "0.2.0", "description": "Web app for the Arma 3 unit Polaris Task Force. Uses Next.js for client- and server-side rendering, with a Postgres database and some other neat libraries.", "license": "MIT", "type": "module", diff --git a/src/components/frontend/eod/EodArena.tsx b/src/components/frontend/eod/EodArena.tsx index dda3793..ea39db9 100644 --- a/src/components/frontend/eod/EodArena.tsx +++ b/src/components/frontend/eod/EodArena.tsx @@ -1,7 +1,7 @@ "use client"; import { useCallback, useState } from "react"; -import type { EodStats } from "@/app/(frontend)/eod/actions"; +import type { EodDifficulty, EodStats } from "@/app/(frontend)/eod/actions"; import { useRealtimePresence } from "@/hooks/useRealtimePresence"; import { EodLeaderboard } from "./EodLeaderboard"; import { MinesweeperBoard } from "./MinesweeperBoard"; @@ -15,6 +15,7 @@ export function EodArena({ }) { const [refreshKey, setRefreshKey] = useState(0); const [playing, setPlaying] = useState(false); + const [selectedDifficulty, setSelectedDifficulty] = useState("training"); const activeTeams = useRealtimePresence("eod", playing, true); const onPhaseChange = useCallback((phase: "ready" | "playing" | "over") => { setPlaying(phase === "playing"); @@ -26,11 +27,14 @@ export function EodArena({ initialStats={initialStats} onGameRecorded={() => setRefreshKey((key) => key + 1)} onPhaseChange={onPhaseChange} + onDifficultyChange={setSelectedDifficulty} /> ); diff --git a/src/components/frontend/eod/EodLeaderboard.tsx b/src/components/frontend/eod/EodLeaderboard.tsx index 7d71b6c..6073c58 100644 --- a/src/components/frontend/eod/EodLeaderboard.tsx +++ b/src/components/frontend/eod/EodLeaderboard.tsx @@ -10,6 +10,7 @@ import { SelectValue, } from "@/components/ui/select"; import { cn } from "@/lib/utils"; +import type { EodDifficulty } from "@/app/(frontend)/eod/actions"; import type { PresenceParticipant } from "@/hooks/useRealtimePresence"; interface ApiUser { @@ -58,6 +59,8 @@ interface EodLeaderboardProps { refreshKey?: number; currentUserId?: number | string; activeTeams?: PresenceParticipant[]; + difficulty: EodDifficulty; + onDifficultyChange: (difficulty: EodDifficulty) => void; } function rankClass(index: number) { @@ -71,8 +74,9 @@ export function EodLeaderboard({ refreshKey = 0, currentUserId, activeTeams = [], + difficulty, + onDifficultyChange, }: EodLeaderboardProps) { - const [difficulty, setDifficulty] = useState<"training" | "perimeter" | "supplyRoad">("training"); const [rows, setRows] = useState(null); const [failed, setFailed] = useState(false); @@ -146,7 +150,7 @@ export function EodLeaderboard({