-
-
Notifications
You must be signed in to change notification settings - Fork 566
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
Adding pagination feature #1660
Adding pagination feature #1660
Conversation
This reverts commit 6031053.
…ng next-fonts since next-fonts are not in use
…bled forward/back chevron buttons based on page number
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
Thank you, CBID2, for creating this pull request and contributing to LinksHub! 💗
The maintainers will review this Pull Request and provide feedback as soon as possible! 😇
We appreciate your patience and contribution, Keep up the great work! 😀
Hey @Anmol-Baranwal. Review this PR. Ignore the other ones. Same with you @rupali-codes |
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.
- Whenever we move to a new category, it should reset to the initial page i.e. page 1.
The above change is necessary because of UX :)
Also, why did you close the other PRs? Was the conflict too much. I'm just asking.
As mentioned, please attach a screenshot of both the variations (change white and purple on floating widget).
We're ready to go @Anmol-Baranwal and @rupali-codes! :) |
I will review it tomorrow evening. |
@CBID2 I will review this after this is fixed. |
I’ll work on this today and let you know when it is fixed :). I totally forgot about that portion of the code! Thanks for the reminder :)
… On Sep 25, 2023, at 12:34 PM, Anmol Baranwal ***@***.***> wrote:
@CBID2 <https://github.com/CBID2>
You can see the bug here:
https://jam.dev/c/0109513b-4bef-4731-bca1-8297ff9a2c3a
I will review this after this is fixed.
<https://user-images.githubusercontent.com/74038190/270412195-729d1d47-4e99-4552-9c6b-0f5e15840250.png>
—
Reply to this email directly, view it on GitHub <#1660 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AYNULCCY2DFDY7KHGFJC6ZTX4GXANANCNFSM6AAAAAA4SQWIOM>.
You are receiving this because you were mentioned.
|
@CBID2 @Anmol-Baranwal - I think I was able to fix it. Can you verify? |
It works on my end @chris-nowicki! :) |
For me, it's still there at least in the latest deployment. |
Did you refresh it @Anmol-Baranwal? |
In frontend category, you can go to Design Inspirations subcategory, then click page number 2 and then go to Animations subcategory. See if the page number changes. Yeah, I checked the code too, it should work but why is it with me. |
Ah, I see it. Weird! So if the sub category changes it isn't updating but if the main category changes it is. |
@chris-nowicki Yeah! |
The numbers change on both on my end @Anmol-Baranwal. Maybe you need to refresh your browser? |
It should change without refreshing the browser. |
Here's a video of the change @Anmol-Baranwal: Pagination.working.mp4 |
I am thinking it has something to do with State. I am wondering if I should add the variables used in usePagination() to the Global Context? @CBID2 - If you select Design Insipiration, go to page 2, and then select Animations you will see pagination stays on page 2 and doesn't reset to page 1. |
Ohh I see @chris-nowicki. Maybe adding variables could work :) |
@CBID2 @Anmol-Baranwal I think I fixed it! I figured that anytime the totalNumberOfCards change is when the subcategory/category changes. So when that happens the handlePageChange function should run and set the page back to 1. I created a useEffect in the usePagination.tsx hook: useEffect(() => {
handlePageChange(1)
}, [totalNumberOfCards]) I tested it out to see if it works and I think we are good to go :). |
Great @chris-nowicki. We're ready @rupali-codes! :) |
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.
@chris-nowicki @CBID2
Thank you very much. You have truly put in a lot of effort for this. I genuinely appreciate your contribution.
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.
Looks perfect to me, thanks a lot @chris-nowicki & @CBID2 :)
Woohoo! We did it @chris-nowicki! 😊 |
Woohoo! This was so fun to work on with y'all! |
Issues
Closes #1125
Changes proposed
@chris-nowicki and I implemented code that adds page numbers to the cards, creating an easier navigation for users.
Screenshots
Note to reviewers
@rupali-codes and @Anmol-Baranwal, this is a better version of PR #1655.