introduction selectable

This commit is contained in:
Jon Eugster
2023-07-16 23:09:32 +02:00
parent 7568f1dd4a
commit f36695ad5c
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -329,7 +329,7 @@ export function CommandLineInterface(props: {world: string, level: number, data:
// Scroll to element if selection changes
React.useEffect(() => {
if (selectedStep) {
if (typeof selectedStep !== 'undefined') {
Array.from(proofPanelRef.current?.getElementsByClassName(`step-${selectedStep}`)).map((elem) => {
elem.scrollIntoView({block: "center"})
})
+2 -2
View File
@@ -109,7 +109,7 @@ function PlayableLevel({worldId, levelId}) {
// Scroll to element if selection changes
React.useEffect(() => {
if (selectedStep) {
if (typeof selectedStep !== 'undefined') {
Array.from(chatRef.current?.getElementsByClassName(`step-${selectedStep}`)).map((elem) => {
elem.scrollIntoView({block: "center"})
})
@@ -222,7 +222,7 @@ function PlayableLevel({worldId, levelId}) {
<div className="chat-panel">
<div ref={chatRef} className="chat">
{level?.data?.introduction &&
<div className="message information">
<div className={`message information step-0${selectedStep === 0 ? ' selected' : ''}`} onClick={toggleSelection(0)}>
<Markdown>{level?.data?.introduction}</Markdown>
</div>
}