Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d838789

Browse files
committed
Use limit constant
1 parent 8502b05 commit d838789

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

site/src/components/PaginationWidget/PaginationWidget.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export type PaginationWidgetProps = {
2727
const range = (start: number, stop: number, step = 1) =>
2828
Array.from({ length: (stop - start) / step + 1 }, (_, i) => start + i * step)
2929

30-
const DEFAULT_RECORDS_PER_PAGE = 25
30+
export const DEFAULT_RECORDS_PER_PAGE = 25
3131
// Number of pages to the left or right of the current page selection.
3232
const PAGE_NEIGHBORS = 1
3333
// Number of pages displayed for cases where there are multiple ellipsis showing. This can be

site/src/pages/WorkspacesPage/WorkspacesPage.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { useMachine } from "@xstate/react"
2+
import { DEFAULT_RECORDS_PER_PAGE } from "components/PaginationWidget/PaginationWidget"
23
import { FC } from "react"
34
import { Helmet } from "react-helmet-async"
45
import { useNavigate, useSearchParams } from "react-router-dom"
@@ -17,7 +18,7 @@ const WorkspacesPage: FC = () => {
1718
const [workspacesState, send] = useMachine(workspacesMachine, {
1819
context: {
1920
page: currentPage,
20-
limit: 25,
21+
limit: DEFAULT_RECORDS_PER_PAGE,
2122
filter,
2223
},
2324
actions: {

0 commit comments

Comments
 (0)