summaryrefslogtreecommitdiffstats
path: root/ui/src/components/post.tsx
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2020-02-02 14:10:15 -0500
committerDessalines <tyhou13@gmx.com>2020-02-02 14:10:15 -0500
commitccda4d8453f796d3929dbda21c0b2e19099d8b74 (patch)
treeb2326db22c6b1a86402b0f4767def4de9a332fc8 /ui/src/components/post.tsx
parentac943f8951fe7da86aaa9f41ee879ab670786c86 (diff)
Some minor fixes.
Diffstat (limited to 'ui/src/components/post.tsx')
-rw-r--r--ui/src/components/post.tsx19
1 files changed, 19 insertions, 0 deletions
diff --git a/ui/src/components/post.tsx b/ui/src/components/post.tsx
index 9bde8585..a8a94f0b 100644
--- a/ui/src/components/post.tsx
+++ b/ui/src/components/post.tsx
@@ -233,6 +233,18 @@ export class Post extends Component<any, PostState> {
onChange={linkEvent(this, this.handleCommentSortChange)}
/>
</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>
);
}
@@ -313,6 +325,13 @@ export class Post extends Component<any, PostState> {
+a.comment.deleted - +b.comment.deleted ||
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) {
tree.sort(
(a, b) =>