This commit is contained in:
parent
6571bfd648
commit
74f595e11a
@ -52,7 +52,7 @@ export default function Pagination({ mobilePagination, page, totalPages, onPageC
|
|||||||
const pageNumbers = [];
|
const pageNumbers = [];
|
||||||
const maxPagesToShow = mobilePagination ? 3 : 4;
|
const maxPagesToShow = mobilePagination ? 3 : 4;
|
||||||
let startPage = Math.max(1, currentPage - Math.floor(maxPagesToShow / 2));
|
let startPage = Math.max(1, currentPage - Math.floor(maxPagesToShow / 2));
|
||||||
let endPage = Math.min(totalPages, startPage + maxPagesToShow - 1);
|
const endPage = Math.min(totalPages, startPage + maxPagesToShow - 1);
|
||||||
|
|
||||||
if (endPage - startPage < maxPagesToShow - 1) {
|
if (endPage - startPage < maxPagesToShow - 1) {
|
||||||
startPage = Math.max(1, endPage - maxPagesToShow + 1);
|
startPage = Math.max(1, endPage - maxPagesToShow + 1);
|
||||||
|
Reference in New Issue
Block a user