1
0
Fork 0
mirror of https://github.com/kou029w/_.git synced 2025-02-07 09:38:46 +00:00

use correct href link

This commit is contained in:
Nebel 2020-02-09 03:15:26 +09:00
parent 2d1f516bd3
commit 27b66b1631

View file

@ -49,12 +49,11 @@ export const components = {
h5: (props: {}) => <Typography component="h5" variant="h6" {...props} />,
h6: (props: {}) => <Typography variant="h6" {...props} />,
a: ({ href, ...props }: { href: string }) => {
const url = isValidURL(href)
? href
: `${process.env.NEXT_BASE_PATH}${href}`;
return (
<Link prefetch href={href} as={url}>
const url = `${process.env.NEXT_BASE_PATH}${href}`;
return isValidURL(href) ? (
<MuiLink variant="body1" color="secondary" href={href} {...props} />
) : (
<Link href={href} as={url}>
<MuiLink variant="body1" color="secondary" href={url} {...props} />
</Link>
);