-
Notifications
You must be signed in to change notification settings - Fork 0
feat: pagination of books #19
Conversation
This will make the parent "remember" the page number, so we end up in the same place after looking at a book's details
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested the application, and when i browse between different pages it briefly says "no books found for this search". While the query runs the data is undefined for a moment, and since isLoading were moved after the !data check, this happens between browsing.
|
I wanted the pagination to be showed while loading, but that doesn't really seem possible without a lot of extra code for such a small feature, so I prefer we just show a general "Loading books..." when we switch pages. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works great, approved! Agreed on keeping it simple with "Loading books..." on page switches
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes works perfect, good work. Agreed on leaving as is for now. "Loading books.." is fine for this project, and we can improve the pagination in the next one.
This PR adds pagination so we can look through more books when there are more than 12 results.
Some changes in the API so we support looking for a specific page by using the
pagesearch param.A natural place for the current page state would be
BookGrid. However, we want to remember the page we were on when we're done with looking at a specific book's details. That's why the state has been moved to the parent component. See 80fd2ed