fix rss, add icon

This commit is contained in:
zeppi 2021-07-02 12:38:19 -04:00 committed by jessopb
parent 5e97fdfa0d
commit 22d9495b8d
4 changed files with 24 additions and 6 deletions

View file

@ -358,10 +358,10 @@ function ClaimMenuList(props: Props) {
<hr className="menu__separator" />
{isChannelPage && (
{isChannelPage && IS_WEB && (
<MenuItem className="comment__menu-option" onSelect={handleCopyRssLink}>
<div className="menu__link">
<Icon aria-hidden icon={ICONS.SHARE} />
<Icon aria-hidden icon={ICONS.RSS} />
{__('Copy RSS URL')}
</div>
</MenuItem>

View file

@ -2299,4 +2299,21 @@ export const icons = {
</g>
</svg>
),
[ICONS.RSS]: (props: CustomProps) => (
<svg
viewBox="0 0 24 24"
width={props.size || '18'}
height={props.size || '18'}
xmlns="http://www.w3.org/2000/svg"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
stroke="currentColor"
fill="none"
>
<g>
<path d="M.75 19.497a3.75 3.75 0 107.5 0 3.75 3.75 0 10-7.5 0zM.75 8.844a11.328 11.328 0 0114.4 14.4M.75 1.113a18.777 18.777 0 0122.139 22.123" />
</g>
</svg>
),
};

View file

@ -161,3 +161,4 @@ export const LIVESTREAM_MONOCHROME = 'LivestreamMono';
export const STACK = 'stack';
export const TIME = 'time';
export const GLOBE = 'globe';
export const RSS = 'rss';

View file

@ -46,11 +46,11 @@ async function getFeed(channelClaim) {
const options = {
title: title + ' on ' + SITE_NAME,
description: value ? replaceLineFeeds(value.description) : '',
description: value && value.description ? replaceLineFeeds(value.description) : '',
link: `${URL}/${channelClaim.name}:${channelClaim.claim_id}`,
favicon: URL + '/public/favicon.png',
generator: SITE_NAME + ' RSS Feed',
image: value ? value.thumbnail.url : '',
image: value && value.thumbnail ? value.thumbnail.url : '',
author: {
name: channelClaim.name,
link: URL + '/' + channelClaim.name + ':' + channelClaim.claim_id,
@ -69,8 +69,8 @@ async function getFeed(channelClaim) {
guid: c.claim_id,
id: c.claim_id,
title: value ? value.title : c.name,
description: value ? replaceLineFeeds(value.description) : '',
image: value ? value.thumbnail.url : '',
description: value && value.description ? replaceLineFeeds(value.description) : '',
image: value && value.thumbnail ? value.thumbnail.url : '',
link: URL + '/' + c.name + ':' + c.claim_id,
date: new Date(meta ? meta.creation_timestamp * 1000 : null),
});