Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -65,15 +65,16 @@ export default class Comment extends Component {
|
||||
|
||||
toggleInputVisibility() {
|
||||
const { isInputVisible } = this.state;
|
||||
const onPrevReplyCb = store.get('onPrevReplyCb');
|
||||
|
||||
this.setState({ isInputVisible: !isInputVisible });
|
||||
|
||||
if (this.props.onReplyClick) {
|
||||
if (!isInputVisible) {
|
||||
this.props.onReplyClick(() => this.setState({ isInputVisible: false }));
|
||||
} else {
|
||||
this.props.onReplyClick(null);
|
||||
}
|
||||
if (onPrevReplyCb) onPrevReplyCb();
|
||||
|
||||
if (!isInputVisible) {
|
||||
store.set('onPrevReplyCb', () => this.setState({ isInputVisible: false }));
|
||||
} else {
|
||||
store.set('onPrevReplyCb', null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,6 @@ export default class Root extends Component {
|
||||
this.onSignOut = this.onSignOut.bind(this);
|
||||
this.onBlockedUsersShow = this.onBlockedUsersShow.bind(this);
|
||||
this.onBlockedUsersHide = this.onBlockedUsersHide.bind(this);
|
||||
this.onReplyClick = this.onReplyClick.bind(this);
|
||||
this.onSortChange = this.onSortChange.bind(this);
|
||||
this.onUnblockSomeone = this.onUnblockSomeone.bind(this);
|
||||
this.checkUrlHash = this.checkUrlHash.bind(this);
|
||||
@@ -139,14 +138,6 @@ export default class Root extends Component {
|
||||
});
|
||||
}
|
||||
|
||||
onReplyClick(cb) {
|
||||
if (this.onPrevReplyClickCallback) {
|
||||
this.onPrevReplyClickCallback();
|
||||
}
|
||||
|
||||
this.onPrevReplyClickCallback = cb;
|
||||
}
|
||||
|
||||
onSortChange(sort) {
|
||||
if (sort === this.state.sort) return;
|
||||
|
||||
@@ -247,7 +238,6 @@ export default class Root extends Component {
|
||||
mods={{ level: 0 }}
|
||||
data={thread}
|
||||
onReply={this.addComment}
|
||||
onReplyClick={this.onReplyClick}
|
||||
/>
|
||||
))
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ export default class Thread extends Component {
|
||||
}
|
||||
|
||||
render(props, { collapsed }) {
|
||||
const { data: { comment, replies = [] }, mix, mods = {}, onReplyClick } = props;
|
||||
const { data: { comment, replies = [] }, mix, mods = {} } = props;
|
||||
|
||||
return (
|
||||
<div className={b('thread', props)}>
|
||||
@@ -27,7 +27,6 @@ export default class Thread extends Component {
|
||||
data={comment}
|
||||
mods={{ level: mods.level, collapsed, collapsible: !!replies.length }}
|
||||
onReply={props.onReply}
|
||||
onReplyClick={onReplyClick}
|
||||
onCollapseToggle={this.onCollapseToggle}
|
||||
/>
|
||||
|
||||
@@ -37,7 +36,6 @@ export default class Thread extends Component {
|
||||
data={thread}
|
||||
mods={{ level: mods.level < 5 ? mods.level + 1 : mods.level }}
|
||||
onReply={props.onReply}
|
||||
onReplyClick={onReplyClick}
|
||||
/>
|
||||
))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user