introduction selectable

pull/118/head
Jon Eugster 3 years ago
parent 7568f1dd4a
commit f36695ad5c

@ -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"})
})

@ -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>
}

Loading…
Cancel
Save