From 1a9fb01bcf64a4016fc8167f51871df1a85b692d Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Mon, 8 Apr 2019 20:53:45 +0300 Subject: Cleanup ESLint warnings --- vnext/src/components/Chat.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'vnext/src/components/Chat.js') 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 (
@@ -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 }; -- cgit v1.2.3