mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-28 16:38:10 +00:00
Add most commented (#159)
* Adding MostComments sort. * Updating translations.
This commit is contained in:
parent
aab038580e
commit
27fd4a4626
|
@ -292,6 +292,7 @@ export class Inbox extends Component<any, InboxState> {
|
|||
sort={this.state.sort}
|
||||
onChange={this.handleSortChange}
|
||||
hideHot
|
||||
hideMostComments
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
|
|
@ -245,6 +245,7 @@ export class Search extends Component<any, SearchState> {
|
|||
sort={this.state.sort}
|
||||
onChange={this.handleSortChange}
|
||||
hideHot
|
||||
hideMostComments
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
|
|
|
@ -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<SortSelectProps, SortSelectState> {
|
|||
class="custom-select w-auto mr-2 mb-2"
|
||||
>
|
||||
<option disabled>{i18n.t('sort_type')}</option>
|
||||
{!this.props.hideHot && (
|
||||
<option value={SortType.Hot}>{i18n.t('hot')}</option>
|
||||
)}
|
||||
{!this.props.hideHot && (
|
||||
<option value={SortType.Active}>{i18n.t('active')}</option>
|
||||
)}
|
||||
{!this.props.hideHot && [
|
||||
<option value={SortType.Hot}>{i18n.t('hot')}</option>,
|
||||
<option value={SortType.Active}>{i18n.t('active')}</option>,
|
||||
]}
|
||||
<option value={SortType.New}>{i18n.t('new')}</option>
|
||||
{!this.props.hideMostComments && (
|
||||
<option value={SortType.MostComments}>
|
||||
{i18n.t('most_comments')}
|
||||
</option>
|
||||
)}
|
||||
<option disabled>─────</option>
|
||||
<option value={SortType.TopDay}>{i18n.t('top_day')}</option>
|
||||
<option value={SortType.TopWeek}>{i18n.t('top_week')}</option>
|
||||
|
|
|
@ -382,6 +382,7 @@ export class User extends Component<any, UserState> {
|
|||
sort={this.state.sort}
|
||||
onChange={this.handleSortChange}
|
||||
hideHot
|
||||
hideMostComments
|
||||
/>
|
||||
<a
|
||||
href={`/feeds/u/${this.state.userName}.xml?sort=${this.state.sort}`}
|
||||
|
|
Loading…
Reference in a new issue