my-covid-story / www

We are a group of concerned citizens who could no longer stand by as Ontario is led into a humanitarian crisis. We believe the power of storytelling is an effective means to drive government action.
https://www.mycovidstory.ca
Creative Commons Zero v1.0 Universal
9 stars 5 forks source link

Paginate story feed #126

Open mwickett opened 3 years ago

mwickett commented 3 years ago

We're getting to the point where we have enough stories that we should be paginating the feed page.

LuckeeDev commented 3 years ago

I'm thinking about what would be the best way to handle this. I think we should statically generate a landing page with the first (let's say) 20 stories and then lazily load the next stories via an API call as the user goes through the pages.

What do you think?

mwickett commented 3 years ago

I think we should statically generate all the paginated pages for now - so use getStaticPaths to retrieve the number of pages (say 20 stories per page) and then use getStaticProps to generate each page.

On my phone but I can share more soon.

davesteinberg commented 3 years ago

We just chose the number 100 out of the air. Do we know where things actually get too big, in terms of page size/download time/browser memory?

We might well be able to bump the number up and give ourselves more time before we have to solve this.

davesteinberg commented 3 years ago

Also, have we discussed the user experience? Are we talking true pagination or infinite scroll?

After more than a decade of Twitter, pagination feels very old school, but maybe there are good UX reasons for it.