From 75e1b1d30f7a2acb99844748f65dfa239c025830 Mon Sep 17 00:00:00 2001 From: lingdocs <71590811+lingdocs@users.noreply.github.com> Date: Tue, 21 Sep 2021 16:59:45 -0400 Subject: [PATCH] cleanup --- src/games/GamesBrowser.tsx | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/games/GamesBrowser.tsx b/src/games/GamesBrowser.tsx index dc651ff..a025b85 100644 --- a/src/games/GamesBrowser.tsx +++ b/src/games/GamesBrowser.tsx @@ -1,7 +1,6 @@ import React, { useState } from "react"; import games from "./games"; import { useUser } from "../user-context"; -import GameDisplay from "./GameDisplay"; function GamesBrowser() { const { user } = useUser(); @@ -15,21 +14,21 @@ function GamesBrowser() { {games.map((chapter) => ( <>

{chapter.chapter}

- {chapter.items.map((record) => { - const done = user && user.tests.some(t => t.id === record.id); - const open = opened === record.id; - return
+ {chapter.items.map(({ id, title, Game }) => { + const done = user && user.tests.some(t => t.id === id); + const open = opened === id; + return
-

handleTitleClick(record.id)}> - {open ? "🞃" : "🞂"} {record.title} +

handleTitleClick(id)}> + {open ? "🞃" : "🞂"} {title}

{done ? "✅" : ""}

- {open && } + {open && }
})}