diff --git a/src/components/ui/icon-button/icon-button.tsx b/src/components/ui/icon-button/icon-button.tsx index 851b8b0cb..cca72073c 100644 --- a/src/components/ui/icon-button/icon-button.tsx +++ b/src/components/ui/icon-button/icon-button.tsx @@ -15,14 +15,18 @@ interface IIconButton extends React.ButtonHTMLAttributes { theme?: 'seamless' | 'outlined' | 'secondary' | 'transparent' | 'dark'; /** Override the data-testid */ 'data-testid'?: string; + /** URL address */ + href?: string; } /** A clickable icon. */ const IconButton = React.forwardRef((props: IIconButton, ref: React.ForwardedRef): JSX.Element => { const { src, className, iconClassName, text, theme = 'seamless', ...filteredProps } = props; + const Component = (props.href ? 'a' : 'button') as 'button'; + return ( - + ); }); diff --git a/src/features/account/components/header.tsx b/src/features/account/components/header.tsx index b43f0c83d..30f78a8b0 100644 --- a/src/features/account/components/header.tsx +++ b/src/features/account/components/header.tsx @@ -284,7 +284,7 @@ const Header: React.FC = ({ account }) => { return []; } - if (features.rssFeeds && account.local) { + if (!ownAccount && features.rssFeeds && account.local) { menu.push({ text: intl.formatMessage(messages.subscribeFeed), icon: require('@tabler/icons/outline/rss.svg'), @@ -591,6 +591,25 @@ const Header: React.FC = ({ account }) => { ); }; + const renderRssButton = () => { + if (ownAccount || !features.rssFeeds || !account.local) { + return null; + } + + const href = software === MASTODON ? `${account.url}.rss` : `${account.url}/feed.rss`; + + return ( + + ); + }; + const info = makeInfo(); const menu = makeMenu(); @@ -647,6 +666,8 @@ const Header: React.FC = ({ account }) => { )} + {renderRssButton()} +