From c2529555b50017c057806e8239f2f9699196d117 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Wed, 29 Jun 2022 09:33:21 +0200 Subject: [PATCH] Use `next/link` even in compatibility anchors --- components/compat-old.tsx | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/components/compat-old.tsx b/components/compat-old.tsx index 2e1c0fe..34e63bb 100644 --- a/components/compat-old.tsx +++ b/components/compat-old.tsx @@ -2,6 +2,8 @@ import * as Bluelib from "@steffo/bluelib-react" import TeX from "@matejmazur/react-katex" import stripIndent from "strip-indent" import 'katex/dist/katex.min.css'; +import {default as NextLink} from "next/link" +import { AnchorProps } from "@steffo/bluelib-react/dist/components/common/Anchor"; export const Split = ({title = undefined, children}: any) => { @@ -135,8 +137,19 @@ export const Latex = LatexMath export const B = Bluelib.BringAttention export const I = Bluelib.Idiomatic export const LI = Bluelib.ListUnordered.Item -export const Anchor = Bluelib.Anchor -export const Link = Bluelib.Anchor -export const BaseLink = Bluelib.Anchor + +export const Anchor = (props: AnchorProps) => { + if(!props.href) { + return + } + + return ( + + + + ) +} +export const Link = Anchor +export const BaseLink = Anchor export const r = String.raw