From 8cbc86d45ceb23a582d1dae329eadc8146c45cba Mon Sep 17 00:00:00 2001 From: pdts20 <pdts20@inf.ufpr.br> Date: Tue, 9 Feb 2021 11:28:27 -0300 Subject: [PATCH] issue#2 - Add consult interface --- .eslintcache | 2 +- src/chatbot/LearningOptions.css | 13 ------------- src/chatbot/LearningOptions.jsx | 24 +++++++++++++++++++++--- src/chatbot/chatPage.jsx | 25 +++++++++++++++++++++---- 4 files changed, 43 insertions(+), 21 deletions(-) delete mode 100644 src/chatbot/LearningOptions.css diff --git a/.eslintcache b/.eslintcache index 25dd582..2eaf301 100644 --- a/.eslintcache +++ b/.eslintcache @@ -1 +1 @@ -[{"/home/pedro/biod-ui-react/src/index.jsx":"1","/home/pedro/biod-ui-react/src/App.jsx":"2","/home/pedro/biod-ui-react/src/routes.jsx":"3","/home/pedro/biod-ui-react/src/pages/homePage.jsx":"4","/home/pedro/biod-ui-react/src/components/footer/footer.jsx":"5","/home/pedro/biod-ui-react/src/components/header/header.jsx":"6","/home/pedro/biod-ui-react/src/pages/aboutPage.jsx":"7","/home/pedro/biod-ui-react/src/pages/docsPage.jsx":"8","/home/pedro/biod-ui-react/src/pages/installPage.jsx":"9","/home/pedro/biod-ui-react/src/pages/tutorialPage.jsx":"10","/home/pedro/biod-ui-react/src/chatbot/chatPage.jsx":"11","/home/pedro/biod-ui-react/src/chatbot/MessageParser.js":"12","/home/pedro/biod-ui-react/src/chatbot/ActionProvider.jsx":"13","/home/pedro/biod-ui-react/src/chatbot/config.js":"14","/home/pedro/biod-ui-react/src/chatbot/LearningOptions.jsx":"15","/home/pedro/biod-ui-react/src/chatbot/LinkList.jsx":"16"},{"size":225,"mtime":1612875575239,"results":"17","hashOfConfig":"18"},{"size":269,"mtime":1612875575143,"results":"19","hashOfConfig":"18"},{"size":1104,"mtime":1612877404899,"results":"20","hashOfConfig":"18"},{"size":2569,"mtime":1612875575255,"results":"21","hashOfConfig":"18"},{"size":1109,"mtime":1612875575143,"results":"22","hashOfConfig":"18"},{"size":1737,"mtime":1612875575175,"results":"23","hashOfConfig":"18"},{"size":7787,"mtime":1612875575251,"results":"24","hashOfConfig":"18"},{"size":5345,"mtime":1612875575251,"results":"25","hashOfConfig":"18"},{"size":4384,"mtime":1612875575255,"results":"26","hashOfConfig":"18"},{"size":6246,"mtime":1612875575279,"results":"27","hashOfConfig":"18"},{"size":435,"mtime":1612877570807,"results":"28","hashOfConfig":"18"},{"size":405,"mtime":1612878736619,"results":"29","hashOfConfig":"18"},{"size":881,"mtime":1612878333366,"results":"30","hashOfConfig":"18"},{"size":1448,"mtime":1612878675782,"results":"31","hashOfConfig":"18"},{"size":769,"mtime":1612878701669,"results":"32","hashOfConfig":"18"},{"size":453,"mtime":1612878620646,"results":"33","hashOfConfig":"18"},{"filePath":"34","messages":"35","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"qwbqjt",{"filePath":"36","messages":"37","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"38","messages":"39","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"40","messages":"41","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"42","messages":"43","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"44","messages":"45","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"46","messages":"47","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"48","messages":"49","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"50","messages":"51","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"52","messages":"53","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"54","messages":"55","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"56"},{"filePath":"57","messages":"58","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"59","messages":"60","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"61","messages":"62","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"63","messages":"64","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"65","messages":"66","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/home/pedro/biod-ui-react/src/index.jsx",[],"/home/pedro/biod-ui-react/src/App.jsx",["67","68"],"/home/pedro/biod-ui-react/src/routes.jsx",[],"/home/pedro/biod-ui-react/src/pages/homePage.jsx",[],"/home/pedro/biod-ui-react/src/components/footer/footer.jsx",["69","70"],"/home/pedro/biod-ui-react/src/components/header/header.jsx",[],"/home/pedro/biod-ui-react/src/pages/aboutPage.jsx",[],"/home/pedro/biod-ui-react/src/pages/docsPage.jsx",[],"/home/pedro/biod-ui-react/src/pages/installPage.jsx",[],"/home/pedro/biod-ui-react/src/pages/tutorialPage.jsx",[],"/home/pedro/biod-ui-react/src/chatbot/chatPage.jsx",[],["71","72"],"/home/pedro/biod-ui-react/src/chatbot/MessageParser.js",[],"/home/pedro/biod-ui-react/src/chatbot/ActionProvider.jsx",[],"/home/pedro/biod-ui-react/src/chatbot/config.js",[],"/home/pedro/biod-ui-react/src/chatbot/LearningOptions.jsx",[],"/home/pedro/biod-ui-react/src/chatbot/LinkList.jsx",[],{"ruleId":"73","severity":1,"message":"74","line":1,"column":17,"nodeType":"75","messageId":"76","endLine":1,"endColumn":26},{"ruleId":"73","severity":1,"message":"77","line":3,"column":27,"nodeType":"75","messageId":"76","endLine":3,"endColumn":33},{"ruleId":"73","severity":1,"message":"78","line":4,"column":8,"nodeType":"75","messageId":"76","endLine":4,"endColumn":18},{"ruleId":"79","severity":1,"message":"80","line":52,"column":5,"nodeType":"81","endLine":52,"endColumn":47},{"ruleId":"82","replacedBy":"83"},{"ruleId":"84","replacedBy":"85"},"no-unused-vars","'Component' is defined but never used.","Identifier","unusedVar","'Router' is defined but never used.","'Typography' is defined but never used.","jsx-a11y/alt-text","img elements must have an alt prop, either with meaningful text, or an empty string for decorative images.","JSXOpeningElement","no-native-reassign",["86"],"no-negated-in-lhs",["87"],"no-global-assign","no-unsafe-negation"] \ No newline at end of file +[{"/home/pedro/biod-ui-react/src/index.jsx":"1","/home/pedro/biod-ui-react/src/App.jsx":"2","/home/pedro/biod-ui-react/src/routes.jsx":"3","/home/pedro/biod-ui-react/src/pages/homePage.jsx":"4","/home/pedro/biod-ui-react/src/components/footer/footer.jsx":"5","/home/pedro/biod-ui-react/src/components/header/header.jsx":"6","/home/pedro/biod-ui-react/src/pages/aboutPage.jsx":"7","/home/pedro/biod-ui-react/src/pages/docsPage.jsx":"8","/home/pedro/biod-ui-react/src/pages/installPage.jsx":"9","/home/pedro/biod-ui-react/src/pages/tutorialPage.jsx":"10","/home/pedro/biod-ui-react/src/chatbot/chatPage.jsx":"11","/home/pedro/biod-ui-react/src/chatbot/MessageParser.js":"12","/home/pedro/biod-ui-react/src/chatbot/ActionProvider.jsx":"13","/home/pedro/biod-ui-react/src/chatbot/config.js":"14","/home/pedro/biod-ui-react/src/chatbot/LearningOptions.jsx":"15","/home/pedro/biod-ui-react/src/chatbot/LinkList.jsx":"16"},{"size":225,"mtime":1612875575239,"results":"17","hashOfConfig":"18"},{"size":269,"mtime":1612875575143,"results":"19","hashOfConfig":"18"},{"size":1104,"mtime":1612877404899,"results":"20","hashOfConfig":"18"},{"size":2569,"mtime":1612875575255,"results":"21","hashOfConfig":"18"},{"size":1109,"mtime":1612875575143,"results":"22","hashOfConfig":"18"},{"size":1737,"mtime":1612875575175,"results":"23","hashOfConfig":"18"},{"size":7787,"mtime":1612875575251,"results":"24","hashOfConfig":"18"},{"size":5345,"mtime":1612875575251,"results":"25","hashOfConfig":"18"},{"size":4384,"mtime":1612875575255,"results":"26","hashOfConfig":"18"},{"size":6246,"mtime":1612875575279,"results":"27","hashOfConfig":"18"},{"size":755,"mtime":1612880871673,"results":"28","hashOfConfig":"18"},{"size":405,"mtime":1612878736619,"results":"29","hashOfConfig":"18"},{"size":881,"mtime":1612878333366,"results":"30","hashOfConfig":"18"},{"size":1448,"mtime":1612878675782,"results":"31","hashOfConfig":"18"},{"size":1116,"mtime":1612879365913,"results":"32","hashOfConfig":"18"},{"size":453,"mtime":1612878620646,"results":"33","hashOfConfig":"18"},{"filePath":"34","messages":"35","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"qwbqjt",{"filePath":"36","messages":"37","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"38","messages":"39","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"40","messages":"41","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"42","messages":"43","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"44","messages":"45","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"46","messages":"47","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"48","messages":"49","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"50","messages":"51","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"52","messages":"53","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"54","messages":"55","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"56","messages":"57","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"58","messages":"59","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"60","messages":"61","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"62","messages":"63","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"64","messages":"65","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/home/pedro/biod-ui-react/src/index.jsx",[],"/home/pedro/biod-ui-react/src/App.jsx",["66","67"],"/home/pedro/biod-ui-react/src/routes.jsx",[],"/home/pedro/biod-ui-react/src/pages/homePage.jsx",[],"/home/pedro/biod-ui-react/src/components/footer/footer.jsx",["68","69"],"/home/pedro/biod-ui-react/src/components/header/header.jsx",[],"/home/pedro/biod-ui-react/src/pages/aboutPage.jsx",[],"/home/pedro/biod-ui-react/src/pages/docsPage.jsx",[],"/home/pedro/biod-ui-react/src/pages/installPage.jsx",[],"/home/pedro/biod-ui-react/src/pages/tutorialPage.jsx",[],"/home/pedro/biod-ui-react/src/chatbot/chatPage.jsx",[],"/home/pedro/biod-ui-react/src/chatbot/MessageParser.js",[],"/home/pedro/biod-ui-react/src/chatbot/ActionProvider.jsx",[],"/home/pedro/biod-ui-react/src/chatbot/config.js",[],"/home/pedro/biod-ui-react/src/chatbot/LearningOptions.jsx",[],"/home/pedro/biod-ui-react/src/chatbot/LinkList.jsx",[],{"ruleId":"70","severity":1,"message":"71","line":1,"column":17,"nodeType":"72","messageId":"73","endLine":1,"endColumn":26},{"ruleId":"70","severity":1,"message":"74","line":3,"column":27,"nodeType":"72","messageId":"73","endLine":3,"endColumn":33},{"ruleId":"70","severity":1,"message":"75","line":4,"column":8,"nodeType":"72","messageId":"73","endLine":4,"endColumn":18},{"ruleId":"76","severity":1,"message":"77","line":52,"column":5,"nodeType":"78","endLine":52,"endColumn":47},"no-unused-vars","'Component' is defined but never used.","Identifier","unusedVar","'Router' is defined but never used.","'Typography' is defined but never used.","jsx-a11y/alt-text","img elements must have an alt prop, either with meaningful text, or an empty string for decorative images.","JSXOpeningElement"] \ No newline at end of file diff --git a/src/chatbot/LearningOptions.css b/src/chatbot/LearningOptions.css deleted file mode 100644 index 6b1bf3b..0000000 --- a/src/chatbot/LearningOptions.css +++ /dev/null @@ -1,13 +0,0 @@ -.learning-options-container { - display: flex; - align-items: flex-start; - flex-wrap: wrap; -} - -.learning-option-button { - padding: 0.5rem; - border-radius: 25px; - background: transparent; - border: 1px solid green; - margin: 3px; -} diff --git a/src/chatbot/LearningOptions.jsx b/src/chatbot/LearningOptions.jsx index 848938f..c3d30fb 100644 --- a/src/chatbot/LearningOptions.jsx +++ b/src/chatbot/LearningOptions.jsx @@ -1,8 +1,26 @@ import React from "react"; +import { makeStyles} from '@material-ui/core/styles'; -import "./LearningOptions.css"; +const useStyles = makeStyles({ + learningContainer: { + display: 'flex', + alignItems: 'flex-start', + flexWrap: 'wrap', + }, + + learningButton: { + padding: '0.5rem', + borderRadius: '25px', + background: 'transparent', + border: '1px solid green', + margin: '3px', + } + +}) const LearningOptions = (props) => { + const classes = useStyles(); + const options = [ { text: "Javascript", @@ -17,7 +35,7 @@ const LearningOptions = (props) => { const optionsMarkup = options.map((option) => ( <button - className="learning-option-button" + className={classes.learningButton} key={option.id} onClick={option.handler} > @@ -25,7 +43,7 @@ const LearningOptions = (props) => { </button> )); - return <div className="learning-options-container">{optionsMarkup}</div>; + return <div className={classes.learningContainer}>{optionsMarkup}</div>; }; export default LearningOptions; diff --git a/src/chatbot/chatPage.jsx b/src/chatbot/chatPage.jsx index b3eee23..860ff23 100644 --- a/src/chatbot/chatPage.jsx +++ b/src/chatbot/chatPage.jsx @@ -1,16 +1,33 @@ import React from 'react'; import Chatbot from 'react-chatbot-kit' +import { makeStyles } from '@material-ui/core/styles'; +import Grid from "@material-ui/core/Grid"; import ActionProvider from './ActionProvider'; import MessageParser from './MessageParser'; import config from './config'; +const useStyles = makeStyles({ + root: { + marginTop: '1em' +} + +}) + export default function ChatPage() { + const classes = useStyles() return ( - <div className="App"> - <header className="App-header"> + <Grid container className={classes.root}> + <Grid item xs sm> + </Grid> + + <Grid item xs={8} sm={8} md={3} lg={3} xl={3}> <Chatbot config={config} actionProvider={ActionProvider} messageParser={MessageParser} /> - </header> - </div> + </Grid> + + <Grid item xs sm> + </Grid> + + </Grid> ); } \ No newline at end of file -- GitLab