reorganisational draft
This commit is contained in:
@@ -13,6 +13,7 @@ export function Inventory({levelInfo, setInventoryDoc } :
|
||||
setInventoryDoc: (inventoryDoc: {name: string, type: string}) => void,
|
||||
}) {
|
||||
|
||||
// TODO: This seems like a useless wrapper to me
|
||||
function openDoc(name, type) {
|
||||
setInventoryDoc({name, type})
|
||||
}
|
||||
@@ -103,6 +104,8 @@ export function Documentation({name, type}) {
|
||||
|
||||
return <>
|
||||
<h2 className="doc">{doc.data?.displayName}</h2>
|
||||
<Markdown>{doc.data?.text}</Markdown>
|
||||
<p><code>{doc.data?.statement}</code></p>
|
||||
{/* <code>docstring: {doc.data?.docstring}</code> */}
|
||||
<Markdown>{doc.data?.content}</Markdown>
|
||||
</>
|
||||
}
|
||||
|
||||
@@ -171,6 +171,7 @@ function PlayableLevel({worldId, levelId}) {
|
||||
}
|
||||
}, [editor, commandLineMode])
|
||||
|
||||
// if this is set to a pair `(name, type)` then the according doc will be open.
|
||||
const [inventoryDoc, setInventoryDoc] = useState<{name: string, type: string}>(null)
|
||||
|
||||
const levelTitle = <>{levelId && `Level ${levelId}`}{level?.data?.title && `: ${level?.data?.title}`}</>
|
||||
|
||||
Reference in New Issue
Block a user