Migrate to Next

This commit is contained in:
2022-11-11 22:41:53 +00:00
parent 58e38dbedd
commit 4aaad4d704
352 changed files with 15583 additions and 21335 deletions

20
components/Link.js Normal file
View File

@@ -0,0 +1,20 @@
import React from "react";
import NextLink from "next/link";
import styles from "./Link.module.css";
export default function Link({ href, children, ...rest }) {
if (/^\/(?!\/)/.test(href)) {
return (
<NextLink href={href} passHref>
<a className={styles.block} {...rest}>
{children}
</a>
</NextLink>
);
}
return (
<a className={styles.block} href={href} {...rest}>
{children}
</a>
);
}