Skip to content

Commit

Permalink
fix: pagination bug
Browse files Browse the repository at this point in the history
  • Loading branch information
kasin-it committed Oct 18, 2024
1 parent 6503423 commit 82b13d5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion starters/shopify-meilisearch/components/product-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const ProductCard = ({ variants, handle, title, featuredImage, minPrice,
<h3 className="line-clamp-2 text-lg font-semibold transition-colors">{title.split(" ").slice(1).join(" ")}</h3>
<div className="flex flex-col gap-1">
{!!vendor && <p className="text-sm text-gray-500">{vendor}</p>}
<div className="mt-1 flex items-center gap-1 flex-wrap">
<div className="mt-1 flex flex-wrap items-center gap-1">
{!!avgRating && !!totalReviews && (
<>
<div className="flex items-center space-x-1">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,7 @@ export function PaginationSection({ queryParams, totalPages }: PaginationSection
</PaginationItem>
{pages.map((singlePage, idx) => (
<PaginationItem key={"pagination_item" + idx + singlePage}>
<PaginationLink
aria-label={`Go to ${singlePage} page`}
isActive={singlePage === +page}
// has to be undefined, null leaves it like ?page=
href={{ query: { ...queryParams, page: singlePage === 1 ? undefined : singlePage } }}
>
<PaginationLink aria-label={`Go to ${singlePage} page`} isActive={singlePage === +page} href={{ query: { ...queryParams, page: singlePage } }}>
{singlePage}
</PaginationLink>
</PaginationItem>
Expand Down

0 comments on commit 82b13d5

Please sign in to comment.