-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/scrollup pagination v2 #244
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
dave-cao
force-pushed
the
feature/scrollupPaginationV2
branch
from
June 4, 2024 05:27
dd1ec92
to
55a98b9
Compare
…m-Collective/One-Accord into feature/scrollupPaginationV2
…m-Collective/One-Accord into feature/scrollupPaginationV2
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Pull Request Checklist
Please make sure you've checked the following items before submitting your pull request:
npm run build
)?npm run format
)?console.log
statements?Additional Technical Comments
All changes were made within
components > liveFeed
The purpose of this pull request is to make it so when users scroll to the top of the container, it would load an additional 10 posts. This would keep going until the max posts for that container is reached.
Feature Breakdown (Scroll down for video)
queries.ts
: previously we had a function grab 10 posts be it either Moderator or general posts, and then we would filter and separate it, however this mean scrolling up would grab either moderator or general posts. I wanted to separate these two types of posts so I created 2 new supabase query functions to grab moderator posts and general posts separatelyuseScroll.ts
: previouslyuseScrollToBottom.ts
, I found that it was appropriate to merge this hook into a generaluseScroll.ts
hook. In addition to the scroll to bottom functionality, I added a scroll to top feature as well (to induce pagination)usePagination.ts
: this hook handles the pagination for both the moderator container and the general posts containeruseFetchPosts.ts
: this hook is a helper hook foruseLiveFeed.ts
. I just broke down the fetch for both moderator posts and other postsFeature Demonstration
scrollup_paginationdemo.mp4