pagination fix
This commit is contained in:
@@ -34,6 +34,7 @@ const PaginationControl = (props) => {
|
||||
};
|
||||
|
||||
const paginationNumbers = (currentPage, pageCount) => {
|
||||
//console.log(currentPage);
|
||||
let delta;
|
||||
|
||||
if (pageCount <= 7) {
|
||||
@@ -43,7 +44,7 @@ const PaginationControl = (props) => {
|
||||
// delta === 2: [1 ... 4 5 6 ... 10]
|
||||
// delta === 4: [1 2 3 4 5 ... 10]
|
||||
//delta = currentPage > 4 && currentPage < pageCount - 3 ? 4 : 4;
|
||||
delta = currentPage > 4 && currentPage < pageCount - 3 ? 2 : 4;
|
||||
delta = currentPage > 4 && currentPage < pageCount - 3 ? 4 : 4;
|
||||
}
|
||||
|
||||
const range = {
|
||||
@@ -79,10 +80,12 @@ const PaginationControl = (props) => {
|
||||
return pages;
|
||||
};
|
||||
|
||||
const paginationArray = paginationNumbers(currentPage, pagesCount);
|
||||
const paginationArray = paginationNumbers(
|
||||
props.currentView.currentPage,
|
||||
pagesCount
|
||||
);
|
||||
return (
|
||||
<>
|
||||
{" "}
|
||||
{pagesCount > 1 && (
|
||||
<div className="govuk-!-margin-bottom-7 ">
|
||||
<div className="govuk-grid-row paginationWrapper">
|
||||
|
||||
Reference in New Issue
Block a user