feat: add message pagination to buy-me-coffee so you can read all messages #516
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changed? Why?
Pagination of messages in buy-me-coffee
I forked the repo to build and noticed a comment that had a "pagination TODO" in the buy-me-coffee app. I was implementing pagination in my fork anyway, so I figured the based thing to do is also commit it to BOAT. Video demo
✅ Page size is configurable and set to 5 so that the Guide is still relatively close to the fold
✅ Current page displayed
✅ Read older messages button is disabled if you're on the first page
✅ Read newer messages button is disabled if there are no newer records
Notes to reviewers
Unfortunately the smart contract doesn't return the number of messages / memos, there's no good way of knowing the total without starting at 0 and counting up to the end, so messages go from oldest to newest rather than newest to oldest, which would be more ideal.
If the smart contract is refactored, you can reuse most of my pagination solution☺️
How has it been tested?
Tested on by creating a new BOAT app with this version of the template on localhost - Video demo: pagination of messages in buy-me-coffee