aboutsummaryrefslogtreecommitdiff
path: root/vnext/src/components/Thread.js
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-06-25 13:02:30 +0300
committerGravatar Vitaly Takmazov2023-01-13 10:37:53 +0300
commit28679bfba2d4160cd54fe368e5412aa622cd8c6e (patch)
treea532f4074a9492733a9bad67ed552d8bf18bb3ee /vnext/src/components/Thread.js
parentcfc03954dcc9d4446e5993c6cdfb5e7e73d71a71 (diff)
transform-class-properties
Diffstat (limited to 'vnext/src/components/Thread.js')
-rw-r--r--vnext/src/components/Thread.js8
1 files changed, 3 insertions, 5 deletions
diff --git a/vnext/src/components/Thread.js b/vnext/src/components/Thread.js
index 5ff91346..17c5b55c 100644
--- a/vnext/src/components/Thread.js
+++ b/vnext/src/components/Thread.js
@@ -21,8 +21,6 @@ export default class Thread extends React.Component {
replies: [],
active: 0
};
- this.loaded = this.loaded.bind(this);
- this.postComment = this.postComment.bind(this);
}
componentDidMount() {
document.body.scrollTop = 0;
@@ -55,7 +53,7 @@ export default class Thread extends React.Component {
console.log(ex);
});
}
- loaded() {
+ loaded = () => {
return (this.state.replies && this.state.replies.length > 0) || ('mid' in this.state.msg && !('replies' in this.state.msg));
}
setActive(msg, event) {
@@ -63,7 +61,7 @@ export default class Thread extends React.Component {
active: msg.rid || 0
})
}
- postComment(template) {
+ postComment = (template) => {
const url = `https://api.juick.com/comment?hash=${this.props.visitor.hash}`;
let form = new FormData();
form.append('mid', template.mid);
@@ -150,7 +148,7 @@ export default class Thread extends React.Component {
{
this.props.visitor.uid > 0 ? (
<React.Fragment>
- {this.state.active === msg.rid || <Button onClick={this.setActive.bind(this, msg)}><Icon name="ei-envelope" size="s" />Reply</Button>}
+ {this.state.active === msg.rid || <Button onClick={() => this.setActive(msg)}><Icon name="ei-envelope" size="s" />Reply</Button>}
{this.state.active === msg.rid && <MessageInput data={msg} onSend={this.postComment} />}
</React.Fragment>
) : (