Fixed bug caused due to outdated libraries
This commit is contained in:
@@ -11,10 +11,6 @@ const ChatCard = ({chat}) => {
|
||||
);
|
||||
};
|
||||
|
||||
ChatCard.defaultProps = {
|
||||
|
||||
};
|
||||
|
||||
ChatCard.propTypes = {
|
||||
|
||||
};
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
}
|
||||
|
||||
&.pad {
|
||||
padding: 0 15px 15px;
|
||||
padding: 0 5px 15px 15px;
|
||||
}
|
||||
|
||||
.flex {
|
||||
|
||||
@@ -43,7 +43,7 @@ const Image = props => {
|
||||
return window.btoa(binary);
|
||||
};
|
||||
|
||||
console.log(img)
|
||||
// console.log(img)
|
||||
return (
|
||||
<Card className={`${classes.card} c-Image`} onClick={() => props.updateBackgroundDispatcher(img)}>
|
||||
<CardHeader avatar={<ImageHeader image={image.img} />} title={image.img.name} style={{textTransform: 'capitalize'}} />
|
||||
|
||||
@@ -2,9 +2,10 @@ import React from 'react';
|
||||
import {connect} from 'react-redux'
|
||||
import PropTypes from 'prop-types'
|
||||
import $ from 'jquery'
|
||||
import {toggleChatView} from './../../../../pages/Home/actions'
|
||||
import {toggleChatView, updateChatMessages} from './../../../../pages/Home/actions'
|
||||
import CommandAndUserTools from './CommandAndUserTools/CommandAndUserTools';
|
||||
import {Link} from 'react-router-dom';
|
||||
import ChatMessage from './../../../../models/chatmessage.model'
|
||||
|
||||
class CommandPrompt extends React.Component {
|
||||
|
||||
@@ -17,6 +18,7 @@ class CommandPrompt extends React.Component {
|
||||
this.showContextMenu = this.showContextMenu.bind(this)
|
||||
this.initiateDomOpsOnEnter = this.initiateDomOpsOnEnter.bind(this)
|
||||
this.toggleChatView = this.toggleChatView.bind(this)
|
||||
this.executeCommand = this.executeCommand.bind(this)
|
||||
this.timerId = 0
|
||||
}
|
||||
|
||||
@@ -78,6 +80,8 @@ class CommandPrompt extends React.Component {
|
||||
commandField.toggleClass('loading')
|
||||
// this.domOpsService.hideNonCards();
|
||||
let commandVal = commandField.val();
|
||||
const message = new ChatMessage(commandVal, true)
|
||||
this.props.dispatchMessage(message)
|
||||
// console.log(commandVal)
|
||||
if(!commandVal) {
|
||||
// this.domOpsService.showEmptyCommandMessage(this.emptyCommandMessage);
|
||||
@@ -134,10 +138,12 @@ class CommandPrompt extends React.Component {
|
||||
}
|
||||
|
||||
CommandPrompt.props = {
|
||||
dispatchMessage: PropTypes.func,
|
||||
dispatchShowChatView: PropTypes.func
|
||||
}
|
||||
|
||||
const mapDispatchToProps = {
|
||||
dispatchMessage: (message) => updateChatMessages(message),
|
||||
dispatchShowChatView: (chatView) => toggleChatView(chatView)
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
@import 'styles/base/forms';
|
||||
@import 'styles/base/general';
|
||||
@import 'styles/base/lists';
|
||||
@import 'styles/base/material';
|
||||
@import 'styles/base/mixins';
|
||||
@import 'styles/base/typography';
|
||||
@import 'styles/components';
|
||||
|
||||
8
client/src/app/models/chatmessage.model.js
Normal file
8
client/src/app/models/chatmessage.model.js
Normal file
@@ -0,0 +1,8 @@
|
||||
export default class ChatMessage {
|
||||
|
||||
constructor(message, isUser) {
|
||||
this.message = message;
|
||||
this.isUser = isUser;
|
||||
this.timeStamp = Date.now();
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ export const UPDATE_BACKGROUND = 'UPDATE_BACKGROUND'
|
||||
export const UPDATE_MODAL_STATE = 'UPDATE_MODAL_STATE'
|
||||
export const UPDATE_UPLOAD_MODAL_STATE = 'UPDATE_UPLOAD_MODAL_STATE'
|
||||
export const TOGGLE_CHAT_VIEW = 'TOGGLE_CHAT_VIEW'
|
||||
export const UPDATE_CHAT_MESSAGES = 'UPDATE_CHAT_MESSAGES'
|
||||
|
||||
export const updateHomeDataState = (payload) => ({type: HOME_DATA_STATE_RECEIVED, payload})
|
||||
const ds = new DataService()
|
||||
@@ -71,4 +72,11 @@ export const toggleChatView = (chatView) => {
|
||||
}
|
||||
}
|
||||
|
||||
export const updateChatMessages = (message) => {
|
||||
return {
|
||||
type: UPDATE_CHAT_MESSAGES,
|
||||
payload: message
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,12 +8,14 @@ import {
|
||||
UPDATE_BACKGROUND,
|
||||
UPDATE_MODAL_STATE,
|
||||
UPDATE_UPLOAD_MODAL_STATE,
|
||||
TOGGLE_CHAT_VIEW
|
||||
TOGGLE_CHAT_VIEW,
|
||||
UPDATE_CHAT_MESSAGES
|
||||
} from './actions'
|
||||
|
||||
const initialState = Immutable.Map({
|
||||
formErrors: [],
|
||||
formValues: []
|
||||
formValues: [],
|
||||
chatMessages: []
|
||||
})
|
||||
|
||||
const reducer = (state = initialState, action) => {
|
||||
@@ -27,6 +29,11 @@ const reducer = (state = initialState, action) => {
|
||||
case UPDATE_UPLOAD_MODAL_STATE:
|
||||
case TOGGLE_CHAT_VIEW:
|
||||
return state.mergeDeep(action.payload)
|
||||
case UPDATE_CHAT_MESSAGES:
|
||||
console.log(...state.get('chatMessages'))
|
||||
const chatMessages = [...state.get('chatMessages'), action.payload]
|
||||
console.log(chatMessages)
|
||||
return state.setIn('chatMessages', chatMessages)
|
||||
default:
|
||||
return state
|
||||
}
|
||||
|
||||
@@ -125,4 +125,4 @@ sub {
|
||||
|
||||
[hidden] {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
12
client/src/app/styles/base/_material.scss
Normal file
12
client/src/app/styles/base/_material.scss
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
.material-icons {
|
||||
&.md-18 { font-size: 18px; }
|
||||
&.md-24 { font-size: 24px; }
|
||||
&.md-36 { font-size: 36px; }
|
||||
&.md-48 { font-size: 48px; }
|
||||
&.md-dark { color: rgba(0, 0, 0, 0.54); }
|
||||
&.md-dark.md-inactive { color: rgba(0, 0, 0, 0.26); }
|
||||
&.md-light { color: rgba(255, 255, 255, 1); }
|
||||
&.md-light.md-inactive { color: rgba(255, 255, 255, 0.3); }
|
||||
&.orange600 { color: #FB8C00; }
|
||||
}
|
||||
Reference in New Issue
Block a user