From 3f7c5d89489adb3d1cf1901f1fef238c2b4354ec Mon Sep 17 00:00:00 2001 From: Christian Moen Date: Tue, 1 Oct 2024 15:25:37 +0200 Subject: [PATCH] add proper anchor tag for external links --- apps/docs/app/routes/_index/ActionLinks.tsx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/apps/docs/app/routes/_index/ActionLinks.tsx b/apps/docs/app/routes/_index/ActionLinks.tsx index 74b768362..406463a55 100644 --- a/apps/docs/app/routes/_index/ActionLinks.tsx +++ b/apps/docs/app/routes/_index/ActionLinks.tsx @@ -1,19 +1,19 @@ -import { Link, useNavigate } from "@remix-run/react"; +import { Link } from "@remix-run/react"; import { ComponentsOutline30Icon, GuidelinesOutline30Icon, HomeOutline30Icon, - StarsOutline30Icon, TokensOutline30Icon, TrainOutline30Icon, + StarsOutline30Icon, } from "@vygruppen/spor-icon-react"; import { Box, BoxProps, - PressableCard, Container, Flex, Heading, + PressableCard, SimpleGrid, Text, } from "@vygruppen/spor-react"; @@ -110,8 +110,14 @@ type ActionLinkCardProps = { children: React.ReactNode; }; function ActionLinkCard({ to, children }: ActionLinkCardProps) { - const linkProps = to.match(/^https?:\/\//) - ? { href: to, target: "_blank", rel: "noopener noreferrer" } + const linkProps: { + href?: string; + target?: string; + rel?: string; + as?: React.ElementType; + to?: string; + } = to.match(/^https?:\/\//) + ? { href: to, target: "_blank", rel: "noopener noreferrer", as: "a" } : { as: Link, to }; return (