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'
/**
@@ -22,7 +22,7 @@ const PaginationNumber = ({ page, totalPage }) => {
return (
<div className='mt-10 mb-5 flex justify-center items-end font-medium text-indigo-400 duration-500 py-3 space-x-2'>
{/* 上一页 */}
<Link
<SmartLink
href={{
pathname:
currentPage === 2
@@ -33,12 +33,12 @@ const PaginationNumber = ({ page, totalPage }) => {
rel='prev'
className={`${currentPage === 1 ? 'invisible' : 'block'} pb-0.5 hover:bg-indigo-400 hover:text-white w-6 text-center cursor-pointer duration-200 hover:font-bold`}>
<i className='fas fa-angle-left' />
</Link>
</SmartLink>
{pages}
{/* 下一页 */}
<Link
<SmartLink
href={{
pathname: `${pagePrefix}/page/${currentPage + 1}`,
query: router.query.s ? { s: router.query.s } : {}
@@ -46,7 +46,7 @@ const PaginationNumber = ({ page, totalPage }) => {
rel='next'
className={`${+showNext ? 'block' : 'invisible'} pb-0.5 hover:bg-indigo-400 hover:text-white w-6 text-center cursor-pointer duration-200 hover:font-bold`}>
<i className='fas fa-angle-right' />
</Link>
</SmartLink>
</div>
)
}
@@ -61,7 +61,7 @@ const PaginationNumber = ({ page, totalPage }) => {
function getPageElement(page, currentPage, pagePrefix) {
const selected = page + '' === currentPage + ''
return (
<Link
<SmartLink
href={page === 1 ? `${pagePrefix}/` : `${pagePrefix}/page/${page}`}
key={page}
passHref
@@ -74,7 +74,7 @@ function getPageElement(page, currentPage, pagePrefix) {
cursor-pointer pb-0.5 w-6 text-center
`}>
{page}
</Link>
</SmartLink>
)
}