Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
[Backoffice] Update in page pagination UIs vs functionalities #1269
base: main
Are you sure you want to change the base?
[Backoffice] Update in page pagination UIs vs functionalities #1269
Changes from 15 commits
67436eb
fe99d2e
150cbc5
cac0fcc
29acfbc
eb208de
c7e1062
24ad72e
0f79a54
2e4257d
77cb224
e8dda96
f34b6fa
6fa4383
b8a46fe
fc85b8c
13c543a
c102581
7b69352
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should create common/hooks and put this hook function to file usePaganation.ts.
Additionally, update the tsconfig.json to add a path alias for @commonHooks pointing to the common/hooks directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've created and started using usePagination.ts instead of PaginationService.ts, and I've also updated tsconfig.json with the @commonHooks path alias.

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks. Please update optional param for usePagination and we can close this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can move this code to common const, beside with:

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’ve updated the code to move
PAGE_SIZE_OPTION
to the common constants fileThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make argument optional:

so that we can use this hook with default page value:
const { pageNo, totalPage, setTotalPage, changePage } = usePagination();
withoutargument.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
usePagination
hook has been updated to make the arguments optional, with default values set forinitialPageNo
andinitialItemsPerPage
. Let me know if there’s anything else you’d like to adjust.