diff --git a/frontend/packages/data-portal/app/components/Link/Link.tsx b/frontend/packages/data-portal/app/components/Link/Link.tsx index 39149cb7c..2a972f820 100644 --- a/frontend/packages/data-portal/app/components/Link/Link.tsx +++ b/frontend/packages/data-portal/app/components/Link/Link.tsx @@ -13,12 +13,19 @@ export type VariantLinkProps = LinkProps & { } function BaseLink( - { to, variant, className, ...props }: VariantLinkProps, + { + href, + to, + variant, + className, + ...props + }: VariantLinkProps & { href?: string }, ref: ForwardedRef, ) { let newTabProps: Partial = {} + const url = href ?? to - if (typeof to === 'string' && isExternalUrl(to)) { + if (typeof url === 'string' && isExternalUrl(url)) { // For new tabs, add rel=noreferrer for security: // https://web.dev/external-anchors-use-rel-noopener/#how-to-improve-your-site's-performance-and-prevent-security-vulnerabilities newTabProps = { @@ -30,7 +37,7 @@ function BaseLink( return ( {t('viewTomogram')}