diff options
Diffstat (limited to 'vnext/src/components/Thread.js')
-rw-r--r-- | vnext/src/components/Thread.js | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/vnext/src/components/Thread.js b/vnext/src/components/Thread.js index 52ca1f0f..7ec6fff6 100644 --- a/vnext/src/components/Thread.js +++ b/vnext/src/components/Thread.js @@ -1,4 +1,8 @@ import React from 'react'; + +import ReactRouterPropTypes from 'react-router-prop-types'; +import { UserType } from './Types'; + import { Link } from 'react-router-dom'; import moment from 'moment'; @@ -31,10 +35,10 @@ export default class Thread extends React.Component { const { mid } = this.props.match.params; let params = { mid: mid - } - if (this.props.visitor && this.props.visitor.hash) { - params.hash = this.props.visitor.hash }; + if (this.props.visitor && this.props.visitor.hash) { + params.hash = this.props.visitor.hash; + } getMessages('/thread', params) .then(response => { let msg = response.data.shift(); @@ -64,9 +68,9 @@ export default class Thread extends React.Component { postComment = (template) => { const { mid, rid, body, attach } = template; comment(mid, rid, body, attach).then(res => { - this.loadReplies() + this.loadReplies(); }) - .catch(console.log) + .catch(console.log); } render() { @@ -155,7 +159,14 @@ export default class Thread extends React.Component { const linkStyle = { cursor: 'pointer' -} +}; + +Thread.propTypes = { + location: ReactRouterPropTypes.location, + history: ReactRouterPropTypes.history, + match: ReactRouterPropTypes.match, + visitor: UserType.isRequired +}; function Recommendations({src, ...rest}) { return src.length > 0 && ( |