From 42db6e19915f8cb86437a556942be0ea5f63ff7f Mon Sep 17 00:00:00 2001 From: Hikari Date: Fri, 6 Mar 2026 14:40:53 -0800 Subject: [PATCH] fix: add show/hide locked toggle to adventurer panel --- .../src/components/game/AdventurerPanel.tsx | 31 +++++++++++++------ 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/apps/web/src/components/game/AdventurerPanel.tsx b/apps/web/src/components/game/AdventurerPanel.tsx index dc2b83c..2cb3dbb 100644 --- a/apps/web/src/components/game/AdventurerPanel.tsx +++ b/apps/web/src/components/game/AdventurerPanel.tsx @@ -1,5 +1,7 @@ import type { Adventurer } from "@elysium/types"; +import { useState } from "react"; import { useGame } from "../../context/GameContext.js"; +import { LockToggle } from "../ui/LockToggle.js"; const CLASS_ICONS: Record = { warrior: "🗡️", @@ -48,22 +50,31 @@ const AdventurerCard = ({ adventurer, currentGold }: AdventurerCardProps): React export const AdventurerPanel = (): React.JSX.Element => { const { state } = useGame(); + const [showLocked, setShowLocked] = useState(true); if (!state) return

Loading...

; + const locked = state.adventurers.filter((a) => !a.unlocked); + const visible = showLocked ? state.adventurers : state.adventurers.filter((a) => a.unlocked); + return (
-

Adventurers

+
+

Adventurers

+ { setShowLocked((v) => !v); }} + /> +
- {state.adventurers - .filter((a) => a.unlocked) - .map((adventurer) => ( - - ))} + {visible.map((adventurer) => ( + + ))}
);