bike-grid-now / bike-grid-monorepo

Contains the code for our monorepo. Doing this so we can query FireCMS safely.
bike-grid-now-website.vercel.app
MIT License
3 stars 1 forks source link

Upcoming Events / Previous Events Pagination #7

Closed benharvey1213 closed 2 years ago

benharvey1213 commented 2 years ago

Don't want to show a million things at one time

samwightt commented 2 years ago

What if we had separate pages for events? /events for the base event page, then /events/:page_num for the page number for pagination.

zakpatterson commented 2 years ago

Taking a pass at this now, it'll get me up to speed with svelte

samwightt commented 2 years ago

@zakpatterson Cool sounds good! For the pagination can you use query params? Realizing that /events/:slug is a route that exists in SvelteKit right now and it wouldn't be good to break that. You can access query params on the params object in the load function in +page.server.ts.

samwightt commented 2 years ago

Also see these docs for how to do pagination with GROQ in Sanity. The GROQ for events is in src/lib/sanity/events.ts.

zakpatterson commented 2 years ago

Ah, I'll attempt to support the route based pagination, since the event data is being created manually by us I thought it would make sense indefinitely to ship all the data to the client and filter / paginate client side.

Might submit these as two prs.

samwightt commented 2 years ago

@zakpatterson Oh shit nevermind, that makes MUCH more sense lol. Pagination with query params is something we should do if we pull events out into a separate page.

zakpatterson commented 2 years ago

Ok, I haven't used vercel much, so I'll open a draft PR now and try out the deployment...