Add sort fields to rss.

- #348
This commit is contained in:
Dessalines 2019-12-01 22:20:01 -08:00
parent 32c1d56bc7
commit fab840a759
3 changed files with 12 additions and 3 deletions

View file

@ -175,7 +175,10 @@ export class Community extends Component<any, State> {
<div class="mb-2"> <div class="mb-2">
<SortSelect sort={this.state.sort} onChange={this.handleSortChange} /> <SortSelect sort={this.state.sort} onChange={this.handleSortChange} />
<a <a
href={`${document.location.origin}/feeds/c/${this.state.communityName}.xml`} href={`/feeds/c/${this.state.communityName}.xml?sort=${
SortType[this.state.sort]
}`}
target="_blank"
> >
<svg class="icon mx-2 text-muted small"> <svg class="icon mx-2 text-muted small">
<use xlinkHref="#icon-rss">#</use> <use xlinkHref="#icon-rss">#</use>

View file

@ -435,7 +435,10 @@ export class Main extends Component<any, MainState> {
<SortSelect sort={this.state.sort} onChange={this.handleSortChange} /> <SortSelect sort={this.state.sort} onChange={this.handleSortChange} />
</span> </span>
{this.state.type_ == ListingType.All && ( {this.state.type_ == ListingType.All && (
<a href={`${document.location.origin}/feeds/all.xml`}> <a
href={`/feeds/all.xml?sort=${SortType[this.state.sort]}`}
target="_blank"
>
<svg class="icon mx-1 text-muted small"> <svg class="icon mx-1 text-muted small">
<use xlinkHref="#icon-rss">#</use> <use xlinkHref="#icon-rss">#</use>
</svg> </svg>

View file

@ -250,7 +250,10 @@ export class User extends Component<any, UserState> {
/> />
</span> </span>
<a <a
href={`${document.location.origin}/feeds/u/${this.state.username}.xml`} href={`/feeds/u/${this.state.username}.xml?sort=${
SortType[this.state.sort]
}`}
target="_blank"
> >
<svg class="icon mx-2 text-muted small"> <svg class="icon mx-2 text-muted small">
<use xlinkHref="#icon-rss">#</use> <use xlinkHref="#icon-rss">#</use>