|
|
@ -235,6 +235,18 @@ export class Post extends Component<any, PostState> {
|
|
|
|
onChange={linkEvent(this, this.handleCommentSortChange)}
|
|
|
|
onChange={linkEvent(this, this.handleCommentSortChange)}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</label>
|
|
|
|
</label>
|
|
|
|
|
|
|
|
<label
|
|
|
|
|
|
|
|
className={`btn btn-sm btn-secondary pointer ${this.state
|
|
|
|
|
|
|
|
.commentSort === CommentSortType.Old && 'active'}`}
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
{i18n.t('old')}
|
|
|
|
|
|
|
|
<input
|
|
|
|
|
|
|
|
type="radio"
|
|
|
|
|
|
|
|
value={CommentSortType.Old}
|
|
|
|
|
|
|
|
checked={this.state.commentSort === CommentSortType.Old}
|
|
|
|
|
|
|
|
onChange={linkEvent(this, this.handleCommentSortChange)}
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -317,6 +329,13 @@ export class Post extends Component<any, PostState> {
|
|
|
|
+a.comment.deleted - +b.comment.deleted ||
|
|
|
|
+a.comment.deleted - +b.comment.deleted ||
|
|
|
|
b.comment.published.localeCompare(a.comment.published)
|
|
|
|
b.comment.published.localeCompare(a.comment.published)
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
} else if (this.state.commentSort == CommentSortType.Old) {
|
|
|
|
|
|
|
|
tree.sort(
|
|
|
|
|
|
|
|
(a, b) =>
|
|
|
|
|
|
|
|
+a.comment.removed - +b.comment.removed ||
|
|
|
|
|
|
|
|
+a.comment.deleted - +b.comment.deleted ||
|
|
|
|
|
|
|
|
a.comment.published.localeCompare(b.comment.published)
|
|
|
|
|
|
|
|
);
|
|
|
|
} else if (this.state.commentSort == CommentSortType.Hot) {
|
|
|
|
} else if (this.state.commentSort == CommentSortType.Hot) {
|
|
|
|
tree.sort(
|
|
|
|
tree.sort(
|
|
|
|
(a, b) =>
|
|
|
|
(a, b) =>
|
|
|
|