Use limit constant

This commit is contained in:
Presley Pizzo
2022-10-19 02:53:56 +00:00
parent 8502b054b5
commit d8387897d0
2 changed files with 3 additions and 2 deletions
@@ -27,7 +27,7 @@ export type PaginationWidgetProps = {
const range = (start: number, stop: number, step = 1) =>
Array.from({ length: (stop - start) / step + 1 }, (_, i) => start + i * step)
const DEFAULT_RECORDS_PER_PAGE = 25
export const DEFAULT_RECORDS_PER_PAGE = 25
// Number of pages to the left or right of the current page selection.
const PAGE_NEIGHBORS = 1
// Number of pages displayed for cases where there are multiple ellipsis showing. This can be
@@ -1,4 +1,5 @@
import { useMachine } from "@xstate/react"
import { DEFAULT_RECORDS_PER_PAGE } from "components/PaginationWidget/PaginationWidget"
import { FC } from "react"
import { Helmet } from "react-helmet-async"
import { useNavigate, useSearchParams } from "react-router-dom"
@@ -17,7 +18,7 @@ const WorkspacesPage: FC = () => {
const [workspacesState, send] = useMachine(workspacesMachine, {
context: {
page: currentPage,
limit: 25,
limit: DEFAULT_RECORDS_PER_PAGE,
filter,
},
actions: {