|
@@ -1,7 +1,6 @@
|
|
|
import Link, { LinkProps } from 'next/link';
|
|
import Link, { LinkProps } from 'next/link';
|
|
|
import { Link as ScrollLink } from 'react-scroll';
|
|
import { Link as ScrollLink } from 'react-scroll';
|
|
|
|
|
|
|
|
-import { DEFAULT_AUTO_SCROLL_OPTS } from '~/client/util/smooth-scroll';
|
|
|
|
|
import { useSiteUrl } from '~/stores/context';
|
|
import { useSiteUrl } from '~/stores/context';
|
|
|
import loggerFactory from '~/utils/logger';
|
|
import loggerFactory from '~/utils/logger';
|
|
|
|
|
|
|
@@ -42,12 +41,9 @@ export const NextLink = ({
|
|
|
|
|
|
|
|
// when href is an anchor link
|
|
// when href is an anchor link
|
|
|
if (isAnchorLink(href)) {
|
|
if (isAnchorLink(href)) {
|
|
|
- const to = href.slice(1);
|
|
|
|
|
return (
|
|
return (
|
|
|
- <Link href={href} scroll={false}>
|
|
|
|
|
- <ScrollLink href={href} to={to} className={className} offset={-100} {...DEFAULT_AUTO_SCROLL_OPTS}>
|
|
|
|
|
- {children}
|
|
|
|
|
- </ScrollLink>
|
|
|
|
|
|
|
+ <Link href={href} shallow >
|
|
|
|
|
+ <a href={href} className={className}>{children}</a>
|
|
|
</Link>
|
|
</Link>
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|