Skip to content
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

[Issue #1925]: Make SearchPagination unbounded #1939

Merged
merged 3 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions frontend/src/app/search/SearchForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ export function SearchForm({
<div className="usa-prose">
{searchResults?.data.length >= 1 ? (
<SearchPagination
totalPages={searchResults?.pagination_info?.total_pages}
page={page}
handlePageChange={handlePageChange}
showHiddenInput={true}
Expand All @@ -109,7 +108,6 @@ export function SearchForm({
/>
{searchResults?.data?.length >= 1 ? (
<SearchPagination
totalPages={searchResults?.pagination_info?.total_pages}
page={page}
handlePageChange={handlePageChange}
position={PaginationPosition.Bottom}
Expand Down
3 changes: 0 additions & 3 deletions frontend/src/components/search/SearchPagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export enum PaginationPosition {

interface SearchPaginationProps {
showHiddenInput?: boolean; // Only one of the two SearchPagination should have this set
totalPages: number;
page: number;
handlePageChange: (handlePage: number) => void; // managed in useSearchFormState
paginationRef?: React.RefObject<HTMLInputElement>; // managed in useSearchFormState
Expand All @@ -21,7 +20,6 @@ const MAX_SLOTS = 5;

export default function SearchPagination({
showHiddenInput,
totalPages,
page,
handlePageChange,
paginationRef,
Expand All @@ -46,7 +44,6 @@ export default function SearchPagination({
)}
<Pagination
pathname="/search"
totalPages={totalPages}
currentPage={page}
maxSlots={MAX_SLOTS}
onClickNext={() => handlePageChange(page + 1)}
Expand Down
Loading