diff --git a/client/public/images/angry.png b/client/public/images/angry.png new file mode 100644 index 0000000..cb3c2ab Binary files /dev/null and b/client/public/images/angry.png differ diff --git a/client/public/images/bored.png b/client/public/images/bored.png new file mode 100644 index 0000000..557aa15 Binary files /dev/null and b/client/public/images/bored.png differ diff --git a/client/public/images/disappointed.png b/client/public/images/disappointed.png new file mode 100644 index 0000000..4418ad7 Binary files /dev/null and b/client/public/images/disappointed.png differ diff --git a/client/public/images/excited.jpg b/client/public/images/excited.jpg new file mode 100644 index 0000000..e2c36e8 Binary files /dev/null and b/client/public/images/excited.jpg differ diff --git a/client/public/images/excited.png b/client/public/images/excited.png new file mode 100644 index 0000000..6869310 Binary files /dev/null and b/client/public/images/excited.png differ diff --git a/client/public/images/happy.jpg b/client/public/images/happy.jpg new file mode 100644 index 0000000..52b2a9f Binary files /dev/null and b/client/public/images/happy.jpg differ diff --git a/client/public/images/love.png b/client/public/images/love.png new file mode 100644 index 0000000..f83d52d Binary files /dev/null and b/client/public/images/love.png differ diff --git a/client/public/images/low.jpg b/client/public/images/low.jpg new file mode 100644 index 0000000..16d95cc Binary files /dev/null and b/client/public/images/low.jpg differ diff --git a/client/public/images/naughty.png b/client/public/images/naughty.png new file mode 100644 index 0000000..ae203b5 Binary files /dev/null and b/client/public/images/naughty.png differ diff --git a/client/public/images/sad.jpg b/client/public/images/sad.jpg new file mode 100644 index 0000000..a81bb2c Binary files /dev/null and b/client/public/images/sad.jpg differ diff --git a/client/public/images/scared.png b/client/public/images/scared.png new file mode 100644 index 0000000..b9d37a6 Binary files /dev/null and b/client/public/images/scared.png differ diff --git a/client/public/images/sleepy.png b/client/public/images/sleepy.png new file mode 100644 index 0000000..9ad1bf6 Binary files /dev/null and b/client/public/images/sleepy.png differ diff --git a/client/src/app/components/index.js b/client/src/app/components/index.js index 84b3bd5..0b576b6 100644 --- a/client/src/app/components/index.js +++ b/client/src/app/components/index.js @@ -1,4 +1,8 @@ /* PLOP_INJECT_IMPORT */ +import ChatCard from './ChatCard'; +import ChatView from './ChatView'; +import MoodSelector from './MoodSelector'; +import MoodCard from './MoodCard'; import Progress from './Progress'; import Uploader from './Uploader'; import Dropzone from './Dropzone'; @@ -27,6 +31,10 @@ import PageLoader from './molecules/PageLoader'; export { /* PLOP_INJECT_EXPORT */ + ChatCard, + ChatView, + MoodSelector, + MoodCard, Progress, Uploader, Dropzone, diff --git a/client/src/app/components/molecules/ChatCard/ChatCard.component.scss b/client/src/app/components/molecules/ChatCard/ChatCard.component.scss new file mode 100644 index 0000000..924a1fd --- /dev/null +++ b/client/src/app/components/molecules/ChatCard/ChatCard.component.scss @@ -0,0 +1,17 @@ +.c-ChatCard { + border: 1px solid rgb(221, 152, 23); + border-radius: 10px; + margin-bottom: 20px; + padding: 8px; + width: 65%; + display: flex; + + &.rightFloater { + align-self: flex-end; + justify-content: flex-end; + } + + p { + margin: unset; + } +} diff --git a/client/src/app/components/molecules/ChatCard/ChatCard.js b/client/src/app/components/molecules/ChatCard/ChatCard.js new file mode 100644 index 0000000..4222d6d --- /dev/null +++ b/client/src/app/components/molecules/ChatCard/ChatCard.js @@ -0,0 +1,22 @@ +import React from 'react'; +import PropTypes from 'prop-types'; + +const ChatCard = ({chat}) => { + + const classes = ['c-ChatCard', chat.isUser ? 'rightFloater' : ''].join(' ') + return ( +
+

{chat.text}

+
+ ); +}; + +ChatCard.defaultProps = { + +}; + +ChatCard.propTypes = { + +}; + +export default ChatCard; \ No newline at end of file diff --git a/client/src/app/components/molecules/ChatCard/ChatCard.test.js b/client/src/app/components/molecules/ChatCard/ChatCard.test.js new file mode 100644 index 0000000..5332546 --- /dev/null +++ b/client/src/app/components/molecules/ChatCard/ChatCard.test.js @@ -0,0 +1,8 @@ +import React from 'react'; +import ChatCard from './ChatCard'; + +describe('ChatCard', () => { + it('renders without error', () => { + + }); +}); \ No newline at end of file diff --git a/client/src/app/components/molecules/ChatCard/index.js b/client/src/app/components/molecules/ChatCard/index.js new file mode 100644 index 0000000..ae1746c --- /dev/null +++ b/client/src/app/components/molecules/ChatCard/index.js @@ -0,0 +1,3 @@ +import ChatCard from './ChatCard'; + +export default ChatCard; \ No newline at end of file diff --git a/client/src/app/components/molecules/ChatView/ChatView.component.scss b/client/src/app/components/molecules/ChatView/ChatView.component.scss new file mode 100644 index 0000000..5d05dc1 --- /dev/null +++ b/client/src/app/components/molecules/ChatView/ChatView.component.scss @@ -0,0 +1,35 @@ +.c-ChatView { + margin: 0 20px; + border-radius: 0 0 10px 10px; + padding: 0px; + background: #fff7c7; + width: 50%; + margin-left: 80px; + + .c-display { + max-height: 0; + overflow: hidden; + transition: all .5s ease-in-out; + background: #fff7c7; + border-radius: 0 0 5px 5px; + font-size: 12px; + line-height: 14px; + font-weight: 700; + font-family: 'Courier New', Courier, monospace; + } + + .show { + max-height: 200px; + padding-top: 15px; + overflow: auto; + } + + &.pad { + padding: 0 15px 15px; + } + + .flex { + display: flex; + flex-wrap: wrap; + } +} diff --git a/client/src/app/components/molecules/ChatView/ChatView.js b/client/src/app/components/molecules/ChatView/ChatView.js new file mode 100644 index 0000000..327e44c --- /dev/null +++ b/client/src/app/components/molecules/ChatView/ChatView.js @@ -0,0 +1,63 @@ +import React from 'react'; +import {connect} from 'react-redux'; +import PropTypes from 'prop-types'; +import {createPropsSelector} from 'reselect-immutable-helpers'; +import {getChatViewStatus} from './../../../pages/Home/selectors' +import ChatCard from './../ChatCard' + +const ChatView = props => { + + const classes1 = ['c-ChatView', props.chatView ? 'pad' : ''].join(' ') + const classes2 = ['c-display flex', props.chatView ? 'show' : ''].join(' ') + + const chats = [ + { + isUser: false, + text: "Do something" + }, + { + isUser: true, + text: "Do something else" + }, + { + isUser: true, + text: "Try againg" + }, + { + isUser: false, + text: "Got response from server" + }, + { + isUser: true, + text: "13 images found" + }, + { + isUser: false, + text: "Find colorful images" + } + ] + + const chatCards = chats && chats.map(chat => { + return + }) + return ( +
+
+ {chatCards} +
+
+ ); +}; + +ChatView.propTypes = { + chatView: PropTypes.bool +}; + +const mapStateToProps = createPropsSelector({ + chatView: getChatViewStatus +}) + +export default connect( + mapStateToProps, + null +)(ChatView) \ No newline at end of file diff --git a/client/src/app/components/molecules/ChatView/ChatView.test.js b/client/src/app/components/molecules/ChatView/ChatView.test.js new file mode 100644 index 0000000..8249bd2 --- /dev/null +++ b/client/src/app/components/molecules/ChatView/ChatView.test.js @@ -0,0 +1,8 @@ +import React from 'react'; +import ChatView from './ChatView'; + +describe('ChatView', () => { + it('renders without error', () => { + + }); +}); \ No newline at end of file diff --git a/client/src/app/components/molecules/ChatView/index.js b/client/src/app/components/molecules/ChatView/index.js new file mode 100644 index 0000000..12e7608 --- /dev/null +++ b/client/src/app/components/molecules/ChatView/index.js @@ -0,0 +1,3 @@ +import ChatView from './ChatView'; + +export default ChatView; \ No newline at end of file diff --git a/client/src/app/components/molecules/PrincipalContent/ImageContainer/Image/Image.js b/client/src/app/components/molecules/PrincipalContent/ImageContainer/Image/Image.js index d1287ce..ba76a7e 100644 --- a/client/src/app/components/molecules/PrincipalContent/ImageContainer/Image/Image.js +++ b/client/src/app/components/molecules/PrincipalContent/ImageContainer/Image/Image.js @@ -3,7 +3,7 @@ import PropTypes from 'prop-types'; import {connect} from 'react-redux' import {updateBackground} from './../../../../../pages/Home/actions' -import { makeStyles } from '@material-ui/core/styles'; +import {makeStyles} from '@material-ui/core/styles'; import Card from '@material-ui/core/Card'; import CardHeader from '@material-ui/core/CardHeader' import CardActionArea from '@material-ui/core/CardActionArea'; diff --git a/client/src/app/components/molecules/common/CommandPrompt/CommandPrompt.component.scss b/client/src/app/components/molecules/common/CommandPrompt/CommandPrompt.component.scss index d6170aa..75fd2b5 100644 --- a/client/src/app/components/molecules/common/CommandPrompt/CommandPrompt.component.scss +++ b/client/src/app/components/molecules/common/CommandPrompt/CommandPrompt.component.scss @@ -284,7 +284,7 @@ } .form-control { - padding: .6rem 1em; + padding: .6rem 3em 0.6em 1em; } .container-fluid { @@ -295,8 +295,21 @@ flex-direction: column; } + .c-iFieldContainer { + width: 50%; + border: 1px solid #ced4da; + border-radius: .25rem; + background: white; + } + #command.form-control { - width: 45%; + width: 85%; + margin-right: 15px; + display: inline-block; + border: unset; + &:active, &:focus { + box-shadow: none; + } } #faux { diff --git a/client/src/app/components/molecules/common/CommandPrompt/CommandPrompt.js b/client/src/app/components/molecules/common/CommandPrompt/CommandPrompt.js index 69982b6..15cefd3 100644 --- a/client/src/app/components/molecules/common/CommandPrompt/CommandPrompt.js +++ b/client/src/app/components/molecules/common/CommandPrompt/CommandPrompt.js @@ -1,5 +1,8 @@ import React from 'react'; +import {connect} from 'react-redux' +import PropTypes from 'prop-types' import $ from 'jquery' +import {toggleChatView} from './../../../../pages/Home/actions' import CommandAndUserTools from './CommandAndUserTools/CommandAndUserTools'; import {Link} from 'react-router-dom'; @@ -7,9 +10,13 @@ class CommandPrompt extends React.Component { constructor(props) { super(props) + this.state = { + chatView: false + } this.registerMouseAndKeyboardHandlers = this.registerMouseAndKeyboardHandlers.bind(this) this.showContextMenu = this.showContextMenu.bind(this) this.initiateDomOpsOnEnter = this.initiateDomOpsOnEnter.bind(this) + this.toggleChatView = this.toggleChatView.bind(this) this.timerId = 0 } @@ -71,7 +78,7 @@ class CommandPrompt extends React.Component { commandField.toggleClass('loading') // this.domOpsService.hideNonCards(); let commandVal = commandField.val(); - console.log(commandVal) + // console.log(commandVal) if(!commandVal) { // this.domOpsService.showEmptyCommandMessage(this.emptyCommandMessage); } else { @@ -84,6 +91,13 @@ class CommandPrompt extends React.Component { } } + toggleChatView() { + this.setState({ + chatView: !this.state.chatView + }) + this.props.dispatchShowChatView(!this.state.chatView) + } + render() { return (