diff --git a/client/src/components/landing_page.tsx b/client/src/components/landing_page.tsx index a152b611..1f1e7d7a 100644 --- a/client/src/components/landing_page.tsx +++ b/client/src/components/landing_page.tsx @@ -19,18 +19,16 @@ import { navOpenAtom } from '../store/navigation-atoms'; import { gameIdAtom } from '../store/location-atoms'; import { gameInfoAtomFamily } from '../store/query-atoms'; import { preferencesAtom } from '../store/preferences-atoms'; +import { gameTilesAtom } from '../store/tiles-atoms'; +import { GameTileWithName } from '../store/api'; -function Tile({gameId}: {gameId: string}) { +function Tile({tileWithName}: {tileWithName: GameTileWithName}) { const { t, i18n } = useTranslation() - const [{ data: gameInfo }] = useAtom(gameInfoAtomFamily(gameId)) const [, navigateToGame] = useAtom(gameIdAtom) const [preferences] = useAtom(preferencesAtom) - const gameTile = gameInfo?.tile - - if (!gameTile) { - return <>> - } + const gameTile = tileWithName.tile + const gameId = `g/${tileWithName.owner}/${tileWithName.game}` return
diff --git a/client/src/config.json b/client/src/config.json
index 6abc6db4..3f36e539 100644
--- a/client/src/config.json
+++ b/client/src/config.json
@@ -1,15 +1,4 @@
{
- "allGames": [
- "leanprover-community/nng4",
- "hhu-adam/robo",
- "alexkontorovich/realanalysisgame",
- "djvelleman/stg4",
- "trequetrum/lean4game-logic",
- "emilyriehl/reintroductiontoproofs",
- "jadabouhawili/knightsandknaves-lean4game",
- "zrtmrh/linearalgebragame"
- ],
-
"languages": [
{
"iso": "en",
diff --git a/client/src/store/api.ts b/client/src/store/api.ts
index ed685efa..de996211 100644
--- a/client/src/store/api.ts
+++ b/client/src/store/api.ts
@@ -16,6 +16,12 @@ export interface GameTile {
image: string
}
+export interface GameTileWithName {
+ owner: string
+ game: string
+ tile: GameTile
+}
+
export interface GameInfo {
title?: string,
introduction: string,
diff --git a/client/src/store/tiles-atoms.ts b/client/src/store/tiles-atoms.ts
new file mode 100644
index 00000000..c158fe96
--- /dev/null
+++ b/client/src/store/tiles-atoms.ts
@@ -0,0 +1,17 @@
+import { atomWithQuery } from "jotai-tanstack-query"
+import { GameTileWithName } from "./api"
+import { atom } from "jotai"
+
+
+const gameTilesQueryAtom = atomWithQuery