1
Fork 0
mirror of https://github.com/Steffo99/unisteffo.git synced 2024-11-25 01:14:21 +00:00

Use next/link even in compatibility anchors

This commit is contained in:
Steffo 2022-06-29 09:33:21 +02:00
parent fa2db7e1f2
commit c2529555b5
Signed by: steffo
GPG key ID: 6965406171929D01

View file

@ -2,6 +2,8 @@ import * as Bluelib from "@steffo/bluelib-react"
import TeX from "@matejmazur/react-katex" import TeX from "@matejmazur/react-katex"
import stripIndent from "strip-indent" import stripIndent from "strip-indent"
import 'katex/dist/katex.min.css'; 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) => { export const Split = ({title = undefined, children}: any) => {
@ -135,8 +137,19 @@ export const Latex = LatexMath
export const B = Bluelib.BringAttention export const B = Bluelib.BringAttention
export const I = Bluelib.Idiomatic export const I = Bluelib.Idiomatic
export const LI = Bluelib.ListUnordered.Item export const LI = Bluelib.ListUnordered.Item
export const Anchor = Bluelib.Anchor
export const Link = Bluelib.Anchor export const Anchor = (props: AnchorProps) => {
export const BaseLink = Bluelib.Anchor if(!props.href) {
return <Bluelib.Anchor {...props}/>
}
return (
<NextLink href={props.href}>
<Bluelib.Anchor {...props}/>
</NextLink>
)
}
export const Link = Anchor
export const BaseLink = Anchor
export const r = String.raw export const r = String.raw