mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-05 07:26:46 +00:00
@@ -1,4 +1,4 @@
|
||||
import Link from 'next/link'
|
||||
import SmartLink from '@/components/SmartLink'
|
||||
import { useRouter } from 'next/router'
|
||||
|
||||
/**
|
||||
@@ -18,7 +18,7 @@ const PaginationNumber = ({ page, totalPage }) => {
|
||||
return (
|
||||
<div className="mt-10 mb-5 flex justify-center items-end font-medium text-black duration-500 dark:text-gray-300 py-3 space-x-2">
|
||||
{/* 上一页 */}
|
||||
<Link
|
||||
<SmartLink
|
||||
href={{
|
||||
pathname: currentPage === 2
|
||||
? `${pagePrefix}/`
|
||||
@@ -30,12 +30,12 @@ const PaginationNumber = ({ page, totalPage }) => {
|
||||
|
||||
<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 } : {}
|
||||
@@ -45,14 +45,14 @@ const PaginationNumber = ({ page, totalPage }) => {
|
||||
|
||||
<i className="fas fa-angle-right" />
|
||||
|
||||
</Link>
|
||||
</SmartLink>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
function getPageElement(page, currentPage, pagePrefix) {
|
||||
return (
|
||||
(<Link
|
||||
(<SmartLink
|
||||
href={page === 1 ? `${pagePrefix}/` : `${pagePrefix}/page/${page}`}
|
||||
key={page}
|
||||
passHref
|
||||
@@ -65,7 +65,7 @@ function getPageElement(page, currentPage, pagePrefix) {
|
||||
|
||||
{page}
|
||||
|
||||
</Link>)
|
||||
</SmartLink>)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user