Skip to content

Commit

Permalink
Merge pull request #29 from codeforjapan/fix/remove-temporal-pagination
Browse files Browse the repository at this point in the history
fix: remove pagination temporal logic
  • Loading branch information
sushichan044 authored Mar 7, 2025
2 parents 944a496 + b3ddb23 commit 22279e4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 142 deletions.
11 changes: 4 additions & 7 deletions app/feature/search/components/SearchPagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import Fa6SolidAngleLeft from "~icons/fa6-solid/angle-left";
import Fa6SolidAngleRight from "~icons/fa6-solid/angle-right";

import type { PaginationMeta } from "../../../generated/api/schemas/paginationMeta";
import { buildPaginationMeta } from "../pagination";
import type { noteSearchParamSchema } from "../validation";

type PaginationProps = {
Expand All @@ -29,18 +28,16 @@ export const SearchPagination = ({
visibleItemCount,
...groupProps
}: PaginationProps) => {
const pagination = buildPaginationMeta(meta, currentQuery);

const pageFirstItemIndex = currentQuery.offset + 1;
const totalDisplayedItems = currentQuery.offset + visibleItemCount;

const prevTo = useMemo(
() => (pagination?.prev ? withQuery("/", getQuery(pagination.prev)) : null),
[pagination?.prev],
() => (meta?.prev ? withQuery("/", getQuery(meta.prev)) : null),
[meta?.prev],
);
const nextTo = useMemo(
() => (pagination?.next ? withQuery("/", getQuery(pagination.next)) : null),
[pagination?.next],
() => (meta?.next ? withQuery("/", getQuery(meta.next)) : null),
[meta?.next],
);

const [clickedButton, setClickedButton] = useState<"prev" | "next">();
Expand Down
85 changes: 0 additions & 85 deletions app/feature/search/pagination.test.ts

This file was deleted.

50 changes: 0 additions & 50 deletions app/feature/search/pagination.ts

This file was deleted.

0 comments on commit 22279e4

Please sign in to comment.