fix: render paginate only if more than 1 page

This commit is contained in:
Timothy Lin
2021-05-29 16:13:01 +08:00
parent 88096a536b
commit 2e5a3a5a9a
2 changed files with 6 additions and 4 deletions

View File

@ -86,9 +86,11 @@ export default function ListLayout({ posts, title, initialDisplayPosts = [], pag
})}
</ul>
</div>
{pagination && !searchValue && (
<Pagination currentPage={pagination.currentPage} totalPages={pagination.totalPages} />
)}
{pagination &&
pagination.totalPages > 1 &&
!searchValue(
<Pagination currentPage={pagination.currentPage} totalPages={pagination.totalPages} />
)}
</>
)
}