diff --git a/src/components/dropdown/AvatarWithDropdown.tsx b/src/components/dropdown/AvatarWithDropdown.tsx
index 89e4ed31..f126e774 100644
--- a/src/components/dropdown/AvatarWithDropdown.tsx
+++ b/src/components/dropdown/AvatarWithDropdown.tsx
@@ -4,7 +4,7 @@ import { useLoginContext } from '@/hooks/useLoginContext';
import LanguageSwitcher from '@/components/buttons/LanguageSwitcher';
import ThemeSwitcher from '@/components/buttons/ThemeSwitcher';
-import CustomLink from '@/components/links/CustomLink';
+import { CustomLink } from '@/components/links/CustomLink';
import { DEFAULT_AVATAR } from '@/utils/constants';
diff --git a/src/components/home/Item.tsx b/src/components/home/Item.tsx
index 7767764b..78222d8b 100644
--- a/src/components/home/Item.tsx
+++ b/src/components/home/Item.tsx
@@ -2,7 +2,7 @@ import Link from 'next/link';
import { AiFillFire, AiOutlineEye } from 'react-icons/ai';
import { GoStar, GoVerified } from 'react-icons/go';
-import CustomLink from '@/components/links/CustomLink';
+import { CustomLink } from '@/components/links/CustomLink';
import { fromNow } from '@/utils/day';
import { numFormat } from '@/utils/util';
diff --git a/src/components/layout/ErrorPage.tsx b/src/components/layout/ErrorPage.tsx
index 29e7de97..eb481aa7 100644
--- a/src/components/layout/ErrorPage.tsx
+++ b/src/components/layout/ErrorPage.tsx
@@ -1,8 +1,8 @@
-import Link from 'next/link';
import { IoIosArrowForward } from 'react-icons/io';
import LanguageSwitcher from '@/components/buttons/LanguageSwitcher';
import ThemeSwitcher from '@/components/buttons/ThemeSwitcher';
+import { NoPrefetchLink } from '@/components/links/CustomLink';
type Props = {
httpCode: number;
@@ -24,7 +24,7 @@ const ErrorPage = ({ t, httpCode }: Props) => {
width={500}
/>
-
+
@@ -36,9 +36,9 @@ const ErrorPage = ({ t, httpCode }: Props) => {
-
+
-
+
{
>
{t('footer.feedback')}
-
+
·
-
+
{
>
{t('footer.source')}
-
+
diff --git a/src/components/layout/Footer.tsx b/src/components/layout/Footer.tsx
index f5b63d07..5f654159 100644
--- a/src/components/layout/Footer.tsx
+++ b/src/components/layout/Footer.tsx
@@ -2,7 +2,7 @@ import { AiFillWechat, AiFillWeiboCircle } from 'react-icons/ai';
import { IoLogoRss } from 'react-icons/io';
import { FeedbackModal } from '@/components/dialog/Feedback';
-import CustomLink from '@/components/links/CustomLink';
+import { CustomLink } from '@/components/links/CustomLink';
import FooterLink from './FooterLink';
@@ -30,7 +30,11 @@ const Footer = ({ t }: SideProps) => {
- {t('footer.agreement')}
+
+
+ {t('footer.agreement')}
+
+
·
{t('footer.source')}
diff --git a/src/components/links/CustomLink.tsx b/src/components/links/CustomLink.tsx
index f5b67f8e..2a0fb160 100644
--- a/src/components/links/CustomLink.tsx
+++ b/src/components/links/CustomLink.tsx
@@ -9,7 +9,7 @@ type Props = {
onClick?: any;
} & React.ComponentPropsWithoutRef<'div'>;
-const CustomLink = ({ href, className, children, onClick }: Props) => {
+export const CustomLink = ({ href, className, children, onClick }: Props) => {
const [isMobile, setIsMobile] = useState(false);
useEffect(() => {
if (
@@ -35,4 +35,10 @@ const CustomLink = ({ href, className, children, onClick }: Props) => {
);
};
-export default CustomLink;
+export const NoPrefetchLink = ({ href, children }: Props) => {
+ return (
+
+ {children}
+
+ );
+};
diff --git a/src/components/links/TagItem.tsx b/src/components/links/TagItem.tsx
index 86a40d59..1878e975 100644
--- a/src/components/links/TagItem.tsx
+++ b/src/components/links/TagItem.tsx
@@ -1,4 +1,4 @@
-import Link from 'next/link';
+import { NoPrefetchLink } from '@/components/links/CustomLink';
interface Props {
name: string;
@@ -7,11 +7,11 @@ interface Props {
const TagItem = ({ name, tid }: Props) => {
return (
-
+
{name}
-
+
);
};
diff --git a/src/components/links/TagLink.tsx b/src/components/links/TagLink.tsx
index 104c3494..192bcaf9 100644
--- a/src/components/links/TagLink.tsx
+++ b/src/components/links/TagLink.tsx
@@ -1,4 +1,4 @@
-import Link from 'next/link';
+import { NoPrefetchLink } from '@/components/links/CustomLink';
import { TagType } from '@/types/tag';
@@ -15,7 +15,9 @@ export default function TagLink(props: Props) {
{props.items.map((item: TagType) => {
return (
-
+
{props.tid == item.tid ? (
{item.name}
@@ -25,7 +27,7 @@ export default function TagLink(props: Props) {
{item.name}
)}
-
+
);
})}
diff --git a/src/components/navbar/ArticleBar.tsx b/src/components/navbar/ArticleBar.tsx
index b5713f5a..7d10b2aa 100644
--- a/src/components/navbar/ArticleBar.tsx
+++ b/src/components/navbar/ArticleBar.tsx
@@ -1,8 +1,9 @@
import classNames from 'classnames';
-import Link from 'next/link';
import { useRouter } from 'next/router';
import { AiOutlineArrowLeft } from 'react-icons/ai';
+import { NoPrefetchLink } from '@/components/links/CustomLink';
+
type Props = {
t: (key: string) => string;
};
@@ -41,12 +42,12 @@ const ArticleNavbar = ({ t }: Props) => {
{t('nav.title')}
diff --git a/src/components/navbar/IndexBar.tsx b/src/components/navbar/IndexBar.tsx
index a78c00e8..19614294 100644
--- a/src/components/navbar/IndexBar.tsx
+++ b/src/components/navbar/IndexBar.tsx
@@ -1,10 +1,10 @@
import classNames from 'classnames';
import { NextPage } from 'next';
-import Link from 'next/link';
import useTagHandling from '@/hooks/useTagHandling';
import { RepoModal } from '@/components/dialog/RepoModal';
+import { NoPrefetchLink } from '@/components/links/CustomLink';
import TagLink from '@/components/links/TagLink';
type Props = {
@@ -31,12 +31,12 @@ const IndexBar: NextPage = ({ t, i18n_lang, tid, sort_by }) => {
return (
-
+
{t('nav.featured')}
-
-
+
+
{t('nav.all')}
-
+
{t('nav.tag')}
diff --git a/src/components/navbar/RepoNavbar.tsx b/src/components/navbar/RepoNavbar.tsx
index 06a0cb13..5d3c89a8 100644
--- a/src/components/navbar/RepoNavbar.tsx
+++ b/src/components/navbar/RepoNavbar.tsx
@@ -1,7 +1,8 @@
-import Link from 'next/link';
import { useRouter } from 'next/router';
import { AiOutlineArrowLeft } from 'react-icons/ai';
+import { NoPrefetchLink } from '@/components/links/CustomLink';
+
interface Props {
avatar: string;
uid: string;
@@ -31,7 +32,7 @@ const RepoDetailNavbar = ({ avatar, uid, t }: Props) => {
{t('nav.title')}
-
+
-
+
);
diff --git a/src/components/periodical/item.tsx b/src/components/periodical/item.tsx
index 61575a26..e3d6f10a 100644
--- a/src/components/periodical/item.tsx
+++ b/src/components/periodical/item.tsx
@@ -1,16 +1,16 @@
import { NextPage } from 'next';
-import Link from 'next/link';
import { useTranslation } from 'next-i18next';
import { GoClock, GoRepoForked } from 'react-icons/go';
import { IoIosStarOutline } from 'react-icons/io';
+import { CustomLink, NoPrefetchLink } from '@/components/links/CustomLink';
+
import { redirectRecord } from '@/services/home';
import { fromNow } from '@/utils/day';
import { numFormat } from '@/utils/util';
import Button from '../buttons/Button';
import ImageWithPreview from '../ImageWithPreview';
-import CustomLink from '../links/CustomLink';
import { MDRender } from '../mdRender/MDRender';
import { PeriodicalItem, PeriodicalItemProps } from '@/types/periodical';
@@ -54,7 +54,7 @@ const PeriodItem: NextPage = ({ item, index }) => {
-
+
-
+
diff --git a/src/components/respository/CommentItem.tsx b/src/components/respository/CommentItem.tsx
index 3041b75d..d160ba25 100644
--- a/src/components/respository/CommentItem.tsx
+++ b/src/components/respository/CommentItem.tsx
@@ -1,10 +1,10 @@
-import Link from 'next/link';
import { useEffect, useState } from 'react';
import { AiFillFire } from 'react-icons/ai';
import { GoCommentDiscussion, GoThumbsup } from 'react-icons/go';
import { useLoginContext } from '@/hooks/useLoginContext';
+import { NoPrefetchLink } from '@/components/links/CustomLink';
import Message from '@/components/message';
import Rating from '@/components/respository/Rating';
@@ -115,7 +115,7 @@ const CommentItem = (props: CommentItemProps) => {
@@ -137,13 +137,13 @@ const CommentItem = (props: CommentItemProps) => {
alt='comment_avatar'
/>
-
+
{user?.nickname}
-
+
{isMaker && (
OP
@@ -166,13 +166,13 @@ const CommentItem = (props: CommentItemProps) => {
{t('comment.reply')}
-
+
{props.reply_user?.nickname}
-
+
:
>
)
diff --git a/src/components/respository/Info.tsx b/src/components/respository/Info.tsx
index 08dc2855..3e34b94a 100644
--- a/src/components/respository/Info.tsx
+++ b/src/components/respository/Info.tsx
@@ -1,7 +1,6 @@
import classNames from 'classnames';
import copy from 'copy-to-clipboard';
import ReactECharts from 'echarts-for-react';
-import Link from 'next/link';
import { useEffect, useRef, useState } from 'react';
import {
AiFillCaretUp,
@@ -35,7 +34,7 @@ import Button from '../buttons/Button';
import AddCollection from '../collection/AddCollection';
import BasicDialog from '../dialog/BasicDialog';
import Dropdown, { option } from '../dropdown/Dropdown';
-import CustomLink from '../links/CustomLink';
+import { CustomLink, NoPrefetchLink } from '../links/CustomLink';
import Message from '../message';
import { Repository, RepositoryProps } from '@/types/repository';
@@ -457,23 +456,23 @@ const Info = ({ repo, t, i18n_lang }: RepositoryProps) => {
{t('info.opensource')}
•
-
+
{repo.license}
-
+
)}