Fix links

This commit is contained in:
Marcus Blättermann 2022-11-14 01:59:12 +01:00
parent d3f95831aa
commit d1c4d65590
No known key found for this signature in database
GPG Key ID: A1E1F04008AC450D

View File

@ -1,6 +1,6 @@
import React, { Fragment } from 'react' import React, { Fragment } from 'react'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import { Link as GatsbyLink } from 'gatsby' import NextLink from 'next/link'
import classNames from 'classnames' import classNames from 'classnames'
import Icon from './icon' import Icon from './icon'
@ -58,22 +58,22 @@ export default function Link({
if ((dest && /^#/.test(dest)) || onClick) { if ((dest && /^#/.test(dest)) || onClick) {
return ( return (
<Wrapper> <Wrapper>
<a href={dest} onClick={onClick} className={linkClassNames}> <NextLink href={dest} onClick={onClick} className={linkClassNames}>
{children} {children}
</a> </NextLink>
</Wrapper> </Wrapper>
) )
} }
return ( return (
<Wrapper> <Wrapper>
<GatsbyLink <NextLink
to={dest} href={dest}
className={linkClassNames} className={linkClassNames}
activeClassName={activeClassName} activeClassName={activeClassName}
{...other} {...other}
> >
{content} {content}
</GatsbyLink> </NextLink>
</Wrapper> </Wrapper>
) )
} }
@ -81,9 +81,9 @@ export default function Link({
const relTarget = isInternal ? {} : { rel: 'noopener nofollow noreferrer', target: '_blank' } const relTarget = isInternal ? {} : { rel: 'noopener nofollow noreferrer', target: '_blank' }
return ( return (
<Wrapper> <Wrapper>
<a href={dest} className={linkClassNames} {...relTarget} {...other}> <NextLink href={dest} className={linkClassNames} {...relTarget} {...other}>
{content} {content}
</a> </NextLink>
</Wrapper> </Wrapper>
) )
} }