Skip to content

Commit

Permalink
fix(web): /rss.xml link should be an anchor tag (#17693)
Browse files Browse the repository at this point in the history
* Make sure that rss.xml is an anchor tag

* Remove unneeded ?
  • Loading branch information
RunarVestmann authored Jan 30, 2025
1 parent ae8fb12 commit 2344d07
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import {
Text,
} from '@island.is/island-ui/core'
import { theme } from '@island.is/island-ui/theme'
import { shouldLinkBeAnAnchorTag } from '@island.is/shared/utils'
import {
BoostChatPanel,
boostChatPanelEndpoints,
Expand Down Expand Up @@ -1079,12 +1080,12 @@ export const OrganizationWrapper: React.FC<
title={navigationData.title}
activeItemTitle={activeNavigationItemTitle}
renderLink={(link, item) => {
return item?.href ? (
<NextLink href={item?.href} legacyBehavior>
return !item?.href || shouldLinkBeAnAnchorTag(item.href) ? (
link
) : (
<NextLink href={item.href} legacyBehavior>
{link}
</NextLink>
) : (
link
)
}}
/>
Expand Down
3 changes: 2 additions & 1 deletion libs/shared/utils/src/lib/shouldLinkBeAnAnchorTag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ import { ProjectBasePath } from '@island.is/shared/constants'
* then the link should be an anchor tag instead of a nextlink for example
* */
export const shouldLinkBeAnAnchorTag = (path: string) =>
Object.values(ProjectBasePath).some((basePath) => path.includes(basePath))
Object.values(ProjectBasePath).some((basePath) => path.includes(basePath)) ||
path.startsWith('/rss.xml')

0 comments on commit 2344d07

Please sign in to comment.