Fix basePath?

This commit is contained in:
Max Leiter 2022-03-06 17:25:23 -08:00
parent b0f4cc2781
commit 144574535a
No known key found for this signature in database
GPG key ID: A3512F2F2F17EBDA

View file

@ -3,8 +3,8 @@ import { useRouter } from "next/router";
const Link = (props: LinkProps) => {
const { basePath } = useRouter();
return <GeistLink {...props} href={`/${basePath}/${props.href}`} />
const href = basePath ? `/${basePath}/${props.href}` : props.href;
return <GeistLink {...props} href={href} />
}
export default Link