summaryrefslogtreecommitdiffstats
path: root/ui/src/components
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2019-12-01 17:21:19 -0800
committerDessalines <tyhou13@gmx.com>2019-12-01 17:23:52 -0800
commit52ea7a32db439f9d9b0785ee132d312aa386b33e (patch)
tree95d8d160af95305a99b0ae122e12e2678c48841b /ui/src/components
parent8e5c02f96745d7c30d9636124bbd72dae2f31d4b (diff)
Some RSS work.
- Display rss buttons on front end for user, /c/all, and community pages. Fixes #348. - Some clean up and additions to RSS feeds.
Diffstat (limited to 'ui/src/components')
-rw-r--r--ui/src/components/community.tsx7
-rw-r--r--ui/src/components/main.tsx9
-rw-r--r--ui/src/components/symbols.tsx4
-rw-r--r--ui/src/components/user.tsx7
4 files changed, 26 insertions, 1 deletions
diff --git a/ui/src/components/community.tsx b/ui/src/components/community.tsx
index cfeff085..a8ec9331 100644
--- a/ui/src/components/community.tsx
+++ b/ui/src/components/community.tsx
@@ -174,6 +174,13 @@ export class Community extends Component<any, State> {
return (
<div class="mb-2">
<SortSelect sort={this.state.sort} onChange={this.handleSortChange} />
+ <a
+ href={`${document.location.origin}/feeds/c/${this.state.communityName}.xml`}
+ >
+ <svg class="icon mx-2 text-muted small">
+ <use xlinkHref="#icon-rss">#</use>
+ </svg>
+ </a>
</div>
);
}
diff --git a/ui/src/components/main.tsx b/ui/src/components/main.tsx
index c871db72..403368ab 100644
--- a/ui/src/components/main.tsx
+++ b/ui/src/components/main.tsx
@@ -431,9 +431,16 @@ export class Main extends Component<any, MainState> {
type_={this.state.type_}
onChange={this.handleTypeChange}
/>
- <span class="ml-2">
+ <span class="mx-2">
<SortSelect sort={this.state.sort} onChange={this.handleSortChange} />
</span>
+ {this.state.type_ == ListingType.All && (
+ <a href={`${document.location.origin}/feeds/all.xml`}>
+ <svg class="icon mx-1 text-muted small">
+ <use xlinkHref="#icon-rss">#</use>
+ </svg>
+ </a>
+ )}
</div>
);
}
diff --git a/ui/src/components/symbols.tsx b/ui/src/components/symbols.tsx
index 5506b58f..c7f8232f 100644
--- a/ui/src/components/symbols.tsx
+++ b/ui/src/components/symbols.tsx
@@ -15,6 +15,10 @@ export class Symbols extends Component<any, any> {
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
+ <symbol id="icon-rss" viewBox="0 0 32 32">
+ <title>rss</title>
+ <path d="M4.259 23.467c-2.35 0-4.259 1.917-4.259 4.252 0 2.349 1.909 4.244 4.259 4.244 2.358 0 4.265-1.895 4.265-4.244-0-2.336-1.907-4.252-4.265-4.252zM0.005 10.873v6.133c3.993 0 7.749 1.562 10.577 4.391 2.825 2.822 4.384 6.595 4.384 10.603h6.16c-0-11.651-9.478-21.127-21.121-21.127zM0.012 0v6.136c14.243 0 25.836 11.604 25.836 25.864h6.152c0-17.64-14.352-32-31.988-32z"></path>
+ </symbol>
<symbol id="icon-arrow-down" viewBox="0 0 26 28">
<title>arrow-down</title>
<path d="M25.172 13c0 0.531-0.219 1.047-0.578 1.406l-10.172 10.187c-0.375 0.359-0.891 0.578-1.422 0.578s-1.047-0.219-1.406-0.578l-10.172-10.187c-0.375-0.359-0.594-0.875-0.594-1.406s0.219-1.047 0.594-1.422l1.156-1.172c0.375-0.359 0.891-0.578 1.422-0.578s1.047 0.219 1.406 0.578l4.594 4.594v-11c0-1.094 0.906-2 2-2h2c1.094 0 2 0.906 2 2v11l4.594-4.594c0.359-0.359 0.875-0.578 1.406-0.578s1.047 0.219 1.422 0.578l1.172 1.172c0.359 0.375 0.578 0.891 0.578 1.422z"></path>
diff --git a/ui/src/components/user.tsx b/ui/src/components/user.tsx
index 84656ce7..6fff538f 100644
--- a/ui/src/components/user.tsx
+++ b/ui/src/components/user.tsx
@@ -249,6 +249,13 @@ export class User extends Component<any, UserState> {
hideHot
/>
</span>
+ <a
+ href={`${document.location.origin}/feeds/u/${this.state.username}.xml`}
+ >
+ <svg class="icon mx-2 text-muted small">
+ <use xlinkHref="#icon-rss">#</use>
+ </svg>
+ </a>
</div>
);
}