aboutsummaryrefslogtreecommitdiff
path: root/vnext/src/components/Chat.js
diff options
context:
space:
mode:
Diffstat (limited to 'vnext/src/components/Chat.js')
-rw-r--r--vnext/src/components/Chat.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/vnext/src/components/Chat.js b/vnext/src/components/Chat.js
index e2b8d2f1..9ac2f2e5 100644
--- a/vnext/src/components/Chat.js
+++ b/vnext/src/components/Chat.js
@@ -1,4 +1,5 @@
import React, { useEffect, useState } from 'react';
+import PropTypes from 'prop-types';
import ReactRouterPropTypes from 'react-router-prop-types';
import { UserType } from './Types';
import moment from 'moment';
@@ -35,21 +36,21 @@ export default function Chat(props) {
setChats(response.data);
});
}
- }
+ };
let onMessage = (json) => {
const msg = JSON.parse(json.data);
if (msg.user.uname === props.match.params.user) {
setChats([msg, ...chats]);
}
- }
+ };
let onSend = (template) => {
pm(template.to.uname, template.body)
.then(res => {
loadChat(props.match.params.user);
}).catch(console.log);
- }
+ };
const uname = props.match.params.user;
return (
<div className="msg-cont">
@@ -77,5 +78,6 @@ export default function Chat(props) {
Chat.propTypes = {
visitor: UserType.isRequired,
- match: ReactRouterPropTypes.match.isRequired
+ match: ReactRouterPropTypes.match.isRequired,
+ connection: PropTypes.shape.isRequired
};