feat: change all Link component to SmartLink

Close #3512
This commit is contained in:
anime
2025-07-24 15:06:39 +08:00
parent fc4817e669
commit ba951cd2aa
338 changed files with 1381 additions and 1381 deletions

View File

@@ -1,4 +1,4 @@
import Link from 'next/link'
import SmartLink from '@/components/SmartLink'
import { useRouter } from 'next/router'
import { useState } from 'react'
@@ -23,7 +23,7 @@ export const MenuItem = ({ link }) => {
{/* 普通 MenuItem */}
{!hasSubMenu && (
<li className='group relative whitespace-nowrap'>
<Link
<SmartLink
href={link?.href}
target={link?.target}
className={`ud-menu-scroll mx-8 flex py-2 text-base font-medium text-dark group-hover:text-primary dark:text-white lg:mr-0 lg:inline-flex lg:px-0 lg:py-6 ${
@@ -33,7 +33,7 @@ export const MenuItem = ({ link }) => {
} lg:group-hover:opacity-70`}>
{link?.icon && <i className={link.icon + ' mr-2 my-auto'} />}
{link?.name}
</Link>
</SmartLink>
</li>
)}
@@ -71,7 +71,7 @@ export const MenuItem = ({ link }) => {
: 'hidden opacity-0 invisible'
}`}>
{link.subMenus.map((sLink, index) => (
<Link
<SmartLink
key={index}
href={sLink.href}
target={link?.target}
@@ -81,7 +81,7 @@ export const MenuItem = ({ link }) => {
{link?.icon && <i className={sLink.icon + ' mr-2 my-auto'} />}{' '}
{sLink.title}
</span>
</Link>
</SmartLink>
))}
</div>
</li>