aboutsummaryrefslogtreecommitdiff
path: root/vnext/src/components/Chat.js
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2019-04-08 20:53:45 +0300
committerGravatar Vitaly Takmazov2023-01-13 10:37:54 +0300
commit1a9fb01bcf64a4016fc8167f51871df1a85b692d (patch)
treec8d202ce2722a62208dc3e6e1a10ca9f0d3ded9a /vnext/src/components/Chat.js
parente46fe57e15cda3869b07c624bbc138c441055a9a (diff)
Cleanup ESLint warnings
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
};