diff --git a/src/components/Pagination.jsx b/src/components/Pagination.jsx index 5962087..1c32791 100644 --- a/src/components/Pagination.jsx +++ b/src/components/Pagination.jsx @@ -66,18 +66,16 @@ class Pagination extends React.Component { // less than 10 total pages so show all startPage = 1; endPage = totalPages; - } else { // more than 10 total pages so calculate start and end pages - if (currentPage <= 6) { - startPage = 1; - endPage = 10; - } else if (currentPage + 4 >= totalPages) { - startPage = totalPages - 9; - endPage = totalPages; - } else { - startPage = currentPage - 5; - endPage = currentPage + 4; - } + } else if (currentPage <= 6) { + startPage = 1; + endPage = 10; + } else if (currentPage + 4 >= totalPages) { + startPage = totalPages - 9; + endPage = totalPages; + } else { + startPage = currentPage - 5; + endPage = currentPage + 4; } // calculate start and end item indexes @@ -135,4 +133,4 @@ class Pagination extends React.Component { Pagination.propTypes = propTypes; Pagination.defaultProps -export default Pagination; \ No newline at end of file +export default Pagination;