From 27fd4a4626b60368ae58fd2217e3143fb765f5dd Mon Sep 17 00:00:00 2001 From: Dessalines Date: Mon, 1 Feb 2021 13:48:42 -0500 Subject: [PATCH] Add most commented (#159) * Adding MostComments sort. * Updating translations. --- src/shared/components/inbox.tsx | 1 + src/shared/components/search.tsx | 1 + src/shared/components/sort-select.tsx | 16 ++++++++++------ src/shared/components/user.tsx | 1 + 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/shared/components/inbox.tsx b/src/shared/components/inbox.tsx index 6c6f5d90..1dae9fd0 100644 --- a/src/shared/components/inbox.tsx +++ b/src/shared/components/inbox.tsx @@ -292,6 +292,7 @@ export class Inbox extends Component { sort={this.state.sort} onChange={this.handleSortChange} hideHot + hideMostComments /> ); diff --git a/src/shared/components/search.tsx b/src/shared/components/search.tsx index 65b1a78e..1cdd35f1 100644 --- a/src/shared/components/search.tsx +++ b/src/shared/components/search.tsx @@ -245,6 +245,7 @@ export class Search extends Component { sort={this.state.sort} onChange={this.handleSortChange} hideHot + hideMostComments /> diff --git a/src/shared/components/sort-select.tsx b/src/shared/components/sort-select.tsx index f711703d..ef14a6e8 100644 --- a/src/shared/components/sort-select.tsx +++ b/src/shared/components/sort-select.tsx @@ -7,6 +7,7 @@ interface SortSelectProps { sort: SortType; onChange?(val: SortType): any; hideHot?: boolean; + hideMostComments?: boolean; } interface SortSelectState { @@ -41,13 +42,16 @@ export class SortSelect extends Component { class="custom-select w-auto mr-2 mb-2" > - {!this.props.hideHot && ( - - )} - {!this.props.hideHot && ( - - )} + {!this.props.hideHot && [ + , + , + ]} + {!this.props.hideMostComments && ( + + )} diff --git a/src/shared/components/user.tsx b/src/shared/components/user.tsx index 43f872ce..e5cd9feb 100644 --- a/src/shared/components/user.tsx +++ b/src/shared/components/user.tsx @@ -382,6 +382,7 @@ export class User extends Component { sort={this.state.sort} onChange={this.handleSortChange} hideHot + hideMostComments />