diff --git a/client/src/components/level.css b/client/src/components/level.css index 241e619..862b1bf 100644 --- a/client/src/components/level.css +++ b/client/src/components/level.css @@ -317,7 +317,7 @@ td code { justify-content: center; } -.commandline-interface .content { +.commandline-interface .content, .world-image-container.empty { background-color: #eee; } diff --git a/client/src/components/level.tsx b/client/src/components/level.tsx index 430b594..2a7d975 100644 --- a/client/src/components/level.tsx +++ b/client/src/components/level.tsx @@ -20,7 +20,7 @@ import { EventEmitter } from '../../../node_modules/lean4-infoview/src/infoview/ import { GameIdContext } from '../app' import { ConnectionContext, connection, useLeanClient } from '../connection' import { useAppDispatch, useAppSelector } from '../hooks' -import { useGetGameInfoQuery, useLoadLevelQuery } from '../state/api' +import { useGetGameInfoQuery, useLoadInventoryOverviewQuery, useLoadLevelQuery } from '../state/api' import { changedSelection, codeEdited, selectCode, selectSelections, selectCompleted, helpEdited, selectHelp, selectDifficulty, selectInventory } from '../state/progress' import { store } from '../state/store' @@ -384,12 +384,36 @@ function PlayableLevel() { } +function IntroductionPanel({gameInfo, impressum, closeImpressum}) { + const gameId = React.useContext(GameIdContext) + const {worldId} = useContext(WorldLevelIdContext) + + return
+
+ + {gameInfo.data?.worlds.nodes[worldId].introduction} + + {impressum ? : null} +
+
+ {gameInfo.data?.worldSize[worldId] == 0 ? + : + + } +
+
+} + export default Level /** The site with the introduction text of a world */ function Introduction() { const gameId = React.useContext(GameIdContext) - const {worldId} = useContext(WorldLevelIdContext) + const {mobile} = useContext(MobileContext) + + const inventory = useLoadInventoryOverviewQuery({game: gameId}) const gameInfo = useGetGameInfoQuery({game: gameId}) @@ -406,23 +430,42 @@ function Introduction() { return <>
-
-
- - {gameInfo.data?.worlds.nodes[worldId].introduction} - - {impressum ? : null} -
- {gameInfo.data?.worldSize[worldId] == 0 ? - : - + {mobile ? + + : + + +
+ +
} -
+ } +// {mobile? +// // TODO: This is copied from the `Split` component below... +// <> +//
+// +// +//
+// +// : +// +// +// +// +// +// } + function useLevelEditor(codeviewRef, initialCode, initialSelections, onDidChangeContent, onDidChangeSelection) { const connection = React.useContext(ConnectionContext)