AfterClass-io / afterclass.io-v2

[alpha] v2 of https://afterclass.io!
https://afterclass-io.vercel.app
MIT License
5 stars 2 forks source link

feat(ui): more reviews can be loaded with a see more button #194

Closed Jansen52x closed 1 week ago

Jansen52x commented 1 month ago

closes #144

Context

Previously, there's no way for users to load more reviews than what is initially loaded. This change adds the functionality through a see more button.

Changes

1) See more button added which loads an additional 10 reviews after initial 10

2) New component (LoadMoreReviews) added to handle additional reviews

3) Misc: Changed reviews.json to have identifiable text to distinguish between reviews

Implementation Details

1) Page.tsx will call both the initial set of reviewItems as well as LoadMoreReviews component. 2) Clicking the see more button each time will add the next 10 reviews to the list of reviews in the LoadMoreReviews component, separate from the initial 10 reviews. 3) useRef used such that the page isn't reloaded upon the see more button click

How to Test

On the main page, can scroll to the button and click See More, you will see 10 more reviews loaded

Checklist

vercel[bot] commented 1 month ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
afterclass-io-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 1, 2024 5:30pm