-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat: add inline actions into workspaces table #17636
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
Changes from 1 commit
0ba8372
25d986e
50d9d74
a20a188
6f054b9
fcc5a27
10dcd68
766463d
c14442c
281cf1a
71c6369
3502a22
7d2b8b3
61dc162
ddcb1e9
53c4332
86337e2
821f9d0
b70e28f
b790963
0987ed1
c1d3046
f797506
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,7 +9,7 @@ export const usePagination = ({ | |
| const [searchParams, setSearchParams] = searchParamsResult; | ||
| const page = searchParams.get("page") ? Number(searchParams.get("page")) : 1; | ||
| const limit = DEFAULT_RECORDS_PER_PAGE; | ||
| const offset = page <= 0 ? 0 : (page - 1) * limit; | ||
| const offset = calcOffset(page, limit); | ||
|
|
||
| const goToPage = (page: number) => { | ||
| searchParams.set("page", page.toString()); | ||
|
|
@@ -23,3 +23,7 @@ export const usePagination = ({ | |
| offset, | ||
| }; | ||
| }; | ||
|
|
||
| export const calcOffset = (page: number, limit: number) => { | ||
| return page <= 0 ? 0 : (page - 1) * limit; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This can be turned into
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, do we want to put this function in this file? It's being imported by a lot of files that don't care about the hook
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That is true. I just didn't want to create a module |
||
| }; | ||
Uh oh!
There was an error while loading. Please reload this page.