Skip to content

Commit

Permalink
Merge c1246d3 into f384951
Browse files Browse the repository at this point in the history
  • Loading branch information
mukiienko committed Nov 19, 2020
2 parents f384951 + c1246d3 commit 450ba5d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/Pagination/Pagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ export const Pagination: React.FC<Props> = (props) => {
}

const defineRange = () => {
if (maxPageButtons === 1 && currentPage !== 1) {
if (maxPageButtons === 0) {
return [];
}

if (maxPageButtons === 1) {
return [currentPage];
}

Expand All @@ -57,7 +61,7 @@ export const Pagination: React.FC<Props> = (props) => {
return range;
};

const showButton1 = maxPageButtons > 1 || currentPage === 1;
const showButton1 = maxPageButtons > 1;
const isPrevDisabled = currentPage === 1;
const isNextDisabled = currentPage === totalPages;
const range = defineRange();
Expand Down

0 comments on commit 450ba5d

Please sign in to comment.