forked from se2p/NuzzleBug
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added injected debugger help menu dialogue
- Loading branch information
Stephan Gramüller
committed
Nov 10, 2022
1 parent
66f0ed2
commit 2fa11a5
Showing
20 changed files
with
51,810 additions
and
4,105 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +1,124 @@ | ||
import classNames from 'classnames'; | ||
import PropTypes from 'prop-types'; | ||
import React from 'react'; | ||
import React, {useEffect, useState} from 'react'; | ||
|
||
import styles from './help-menu-body.css'; | ||
import Owl from '../owl/help-menu-owl.jsx'; | ||
import owlHead from './owl-head.svg'; | ||
import {QuestionCategory} from 'scratch-ir'; | ||
import AbstractCategoryComponent from '../abstract-category/abstract-category.jsx'; | ||
import PrevMessageGenerator from '../prev-message-generator/prev-message-generator.jsx'; | ||
import {CSSTransition} from 'react-transition-group'; | ||
|
||
const HelpMenuBodyComponent = function (props) { | ||
const { | ||
abstractCategories, | ||
categories, | ||
onClick, | ||
message, | ||
owlMessage, | ||
userMessage, | ||
injected, | ||
chooseQuestionType | ||
prevMessages | ||
} = props; | ||
|
||
|
||
// const [show, setShow] = useState(false); | ||
|
||
const blockRef = React.useRef(null); | ||
useEffect(() => { | ||
if (blockRef.current) { | ||
blockRef.current.scrollTo({ | ||
top: blockRef.current.scrollHeight, | ||
left: 0, | ||
behavior: 'smooth' | ||
}); | ||
} | ||
// setTimeout(() => setShow(true), 300); | ||
}); | ||
|
||
/* const handleClick = category => { | ||
onClick(category); | ||
};*/ | ||
|
||
return ( | ||
<div | ||
className={styles.body} | ||
className={styles.menu} | ||
> | ||
<div className={styles.menu}> | ||
<div className={styles.header}> | ||
<i className={styles.owlHead}><img src={owlHead} /></i> | ||
<div>{'Owl Chat'}</div> | ||
</div> | ||
<div | ||
className={styles.body} | ||
ref={blockRef} | ||
> | ||
<PrevMessageGenerator | ||
messages={prevMessages} | ||
/> | ||
<div | ||
className={styles.owlArea} | ||
> | ||
<div className={styles.owl}> | ||
<div | ||
className={styles.owl} | ||
> | ||
<Owl | ||
injected={injected} | ||
onSubmit={print} | ||
enabled={false} | ||
text={message} | ||
text={owlMessage} | ||
/> | ||
</div> | ||
</div> | ||
{abstractCategories && abstractCategories.length > 0 ? ( | ||
<div | ||
className={styles.category} | ||
> | ||
{categories && categories.length > 0 ? ( | ||
<div> | ||
<div | ||
className={classNames(styles.speechBubbleBox, styles.speechBubbleTriangle)} | ||
className={styles.category} | ||
> | ||
{/* <CSSTransition | ||
in={show} | ||
timeout={200} | ||
unmountOnExit | ||
classNames="my-node" | ||
>*/} | ||
<div | ||
id="help-messages" | ||
className={styles.helpMessages} | ||
className={classNames(styles.speechBubbleBox, styles.speechBubbleTriangle)} | ||
> | ||
<div> | ||
{'text'} | ||
<div | ||
id="help-messages" | ||
className={styles.helpMessages} | ||
> | ||
<div> | ||
{userMessage} | ||
</div> | ||
<ul className={styles.categoryList}> | ||
{categories.map(category => ( | ||
<li | ||
key={category.id} | ||
> | ||
{category.questionCategories && category.questionCategories.length ? | ||
(<AbstractCategoryComponent | ||
onClick={onClick} | ||
category={category} | ||
abstractCategories={category.questionCategories} | ||
/>) : null} | ||
</li> | ||
))} | ||
</ul> | ||
</div> | ||
<ul className={styles.categoryList}> | ||
{abstractCategories.map(category => ( | ||
<li | ||
key={category.id} | ||
> | ||
{category.questionCategories && category.questionCategories.length ? ( | ||
<AbstractCategoryComponent | ||
onClick={onClick} | ||
category={category} | ||
abstractCategories={category.questionCategories} | ||
/>) : null} | ||
</li> | ||
))} | ||
</ul> | ||
</div> | ||
</div> | ||
</div>) : null} | ||
</div> | ||
</div> | ||
|
||
); | ||
}; | ||
|
||
HelpMenuBodyComponent.propTypes = { | ||
abstractCategories: PropTypes.arrayOf(PropTypes.instanceOf(QuestionCategory)), | ||
chooseQuestionType: PropTypes.bool.isRequired, | ||
categories: PropTypes.arrayOf(PropTypes.instanceOf(QuestionCategory)), | ||
onClick: PropTypes.func.isRequired, | ||
message: PropTypes.string.isRequired, | ||
injected: PropTypes.bool.isRequired | ||
owlMessage: PropTypes.string.isRequired, | ||
userMessage: PropTypes.string.isRequired, | ||
injected: PropTypes.bool.isRequired, | ||
prevMessages: PropTypes.arrayOf(PropTypes.string) | ||
}; | ||
|
||
export default HelpMenuBodyComponent; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.