Frontend - Add page count to the pagination
Once we have pagination, we want to show the page count (e.g Page X of Y) under the prev and next button of the pagination on the catalog list. To do this, we will need to have a counter inside the component that starts at page 1 and increment on handleNextPage
and decrement on handlePreviousPage
.
For the total, since we are getting the count from the graphQL query, we can divide the count by the first
variable value of graphQL. Currently it is hardcoded, so let's make it a constant that we can use.
Then, these values should only be shown when the buttons are shown. If there is only one page, then it can be Page 1 of 1.
Edited by Frédéric Caplette