Skip to content
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

Pagination #19

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

zbendas
Copy link
Contributor

@zbendas zbendas commented Mar 20, 2021

This one is a doozy, but hopefully will be helpful in the long run!

I've created a relatively-extensible (I hope) Pagination component, then put it in place for the Events page. It's got some built-in customization for the child components found within, but by default it shows a react-select dropdown to change how many events appear on the page, a handful of navigational buttons, and another react-select dropdown to jump to a specific page at both the top and bottom of the screen, surrounding the paginated content.

Event Pagination

The pagination elements are responsive, insofar as they'll rearrange themselves using CSS grid properties as much as they can to get out of each other's way on screens lower than the sm breakpoint, with some slight adjustments at the md breakpoint as well, just because I thought the layout looked a little better on that size screen.

Notably, there is no pagination of the loading of Events here, just pagination for their display. EventPage.tsx still loads all the event objects, this just controls how many are made popped in for folks to see.

Please let me know if you've got any feedback!

zbendas added 5 commits March 20, 2021 01:47
Create Pagination.tsx, which should be able to be slotted into any page that has a lengthy list of child elements. This commit enables pagination for the EventsPage.tsx, but this should prove suitable for other pages as well. Of note: this method of pagination does not reduce the initial load time, just changes the way elements are displayed, potentially making them easier to comb through.
Previously, not enough buttons were shown when on the right edge of the potential pages. Now, they should display correctly. The JSDoc string has also been updated to clarify how even numbers behave when used for buttonLimit.
For consistency between this and other pages that use `react-select`, these components have been modified. Both can be styled, simultaneously, from the Pagination component, using `react-select` `styles` objects.
Improves the consistency of PageNav buttons by enforcing a minimum width - rapid clicking is less likely to jumbled you up.
Fixes an incorrect property in the `grid-rows-update-mobile` Tailwind, which now works as expected -- but without being an invalid property value. Game update layouts now flow a bit better together.
Adds `grid-rows-pagination-mobile` and addresses some layout issues with small screens. Some tiny visual improvements tucked in there as well.
Snipe another CSS issue while I'm here! PageButtons were displaying a little poorly at 3 characters, so now they're a bit less apt to do that. Also, `PageSizer` was hogging a bit too much room on small screens.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant