From d181e127251082f8efd79f72e49ca286b3ff174b Mon Sep 17 00:00:00 2001 From: BrownKnight Date: Fri, 30 Aug 2024 20:17:14 +0100 Subject: [PATCH] Show category name when a category is solved --- ui/src/grid/InteractiveGrid.tsx | 17 ++++------------- ui/src/grid/SimpleGrid.tsx | 6 ++---- ui/src/timer-battle/TimerBattleScreen.tsx | 3 +-- 3 files changed, 7 insertions(+), 19 deletions(-) diff --git a/ui/src/grid/InteractiveGrid.tsx b/ui/src/grid/InteractiveGrid.tsx index 93ff5f2..673e3a0 100644 --- a/ui/src/grid/InteractiveGrid.tsx +++ b/ui/src/grid/InteractiveGrid.tsx @@ -55,19 +55,10 @@ export default function InteractiveGrid({ grid, onCorrect, onIncorrect }: Props) {matchedCategories.map((category, i) => ( - {category.answers.map((word, j) => { - const color = "bg-green-700 text-white"; - return ( -
7 ? "text-[0.6rem]" : "text-sm" - } md:text-lg ${color}`} - > - {word} -
- ); - })} +
+

{category.name}

+

{category.answers.join(" | ")}

+
))} {_.chunk(remaining, 4).map((words, i) => ( diff --git a/ui/src/grid/SimpleGrid.tsx b/ui/src/grid/SimpleGrid.tsx index bd42308..2fd172a 100644 --- a/ui/src/grid/SimpleGrid.tsx +++ b/ui/src/grid/SimpleGrid.tsx @@ -10,10 +10,8 @@ export default function SimpleGrid({ grid, matchedCount, title }: { grid: Grid; {title &&

{title}

} {_.range(0, matchedCount).map((i) => { return ( -
- {_.range(columnCount).map((j) => ( -
- ))} +
+
); })} diff --git a/ui/src/timer-battle/TimerBattleScreen.tsx b/ui/src/timer-battle/TimerBattleScreen.tsx index e582da1..a379238 100644 --- a/ui/src/timer-battle/TimerBattleScreen.tsx +++ b/ui/src/timer-battle/TimerBattleScreen.tsx @@ -74,9 +74,8 @@ export default function TimerBattleScreen() { {battle.players .filter((x) => x.name !== username) .map((player) => ( -
+