From 1d127718049c2755149e58bd0486474f3f5b04ab Mon Sep 17 00:00:00 2001 From: lingdocs <71590811+lingdocs@users.noreply.github.com> Date: Sat, 18 Sep 2021 23:19:39 -0400 Subject: [PATCH] display check on accomplished game --- src/games/GameDisplay.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/games/GameDisplay.tsx b/src/games/GameDisplay.tsx index 202c0a6..d6e1512 100644 --- a/src/games/GameDisplay.tsx +++ b/src/games/GameDisplay.tsx @@ -1,8 +1,13 @@ import React from "react"; +import { useUser } from "../user-context"; -function GameDisplay({ record: { title, Game } }: { record: GameRecord }) { +function GameDisplay({ record: { title, Game, id } }: { record: GameRecord }) { + const { user } = useUser(); + const completed = user?.tests.some((t) => ( + (t.done === true) && (t.id === id) + )); return
-

🎮 {title}

+

🎮 {title} {completed ? "✅" : ""}

}