BinaryStudioAcademy / bsa-2024-gitfit

Application for collecting and analyzing developers activity on git based projects.
0 stars 0 forks source link

feat: Create a table pagination component #23

Closed liza-veis closed 1 week ago

liza-veis commented 4 weeks ago

What feature?

Screenshots

Pagination

GvoFor commented 3 weeks ago

image Should this part be rendered if there is 1 of 1 pages?

Also according to the design, I see that the background color of buttons is transperent. Do I need to change it on hover (with configured transition?). If so, then what color should it changed to? (one from the figma, or transpepent black, so it looks like tint)

GvoFor commented 3 weeks ago

page and perPage parameters should be stored as URL query string

This means that I don't need any state inside my component, and can just get handlers for buttons/select throuh the props, right?

liza-veis commented 3 weeks ago

Should this part be rendered if there is 1 of 1 pages?

yes

And what about edge cases: do I need to disable buttons (so user can't press them and cursor do not change), which cannot change table (i.e. If there is 10 pages, and current on is first, then first two buttons (go to start and go to previous) are make no sence, cause there is nowhere to move). Or maybe those button even must disapper, instead of become disabled?

let's disable buttons, if there are no pages left to move.

page and perPage parameters should be stored as URL query string

This means that I don't need any state inside my component, and can just get handlers for buttons/select throuh the props, right?

I think there should be a custom hook, like usePagination. Perhaps, you will need both the state inside it and query parameters. You will need to take initial data from query params, then you may need to store parsed info in the local state, and whenever something changes, update query params.

VeronikaHordus commented 1 week ago

Everything is good, thank you !