Skip to content

Commit

Permalink
chore: sets itemsPerPage default
Browse files Browse the repository at this point in the history
  • Loading branch information
hellofanny committed Nov 30, 2023
1 parent a8d774e commit 152a4ac
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/core/src/components/ui/ProductShelf/ProductShelf.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function ProductShelf({
showDiscountBadge = ProductCard.props.showDiscountBadge,
} = {},
numberOfItems,
itemsPerPage,
itemsPerPage = 5,
...otherProps
}: ProductShelfProps) {
const titleId = textToKebabCase(title)
Expand All @@ -57,7 +57,6 @@ function ProductShelf({
const products = data?.search?.products
const productEdges = products?.edges ?? []
const aspectRatio = 1
const itemsPerPageValue = itemsPerPage ? itemsPerPage : 5

const { sendViewItemListEvent } = useViewItemListEvent({
products: productEdges,
Expand All @@ -84,12 +83,12 @@ function ProductShelf({
<ProductShelfSkeleton
aspectRatio={aspectRatio}
loading={products === undefined}
itemsPerPage={itemsPerPageValue}
itemsPerPage={itemsPerPage}
>
<ProductShelfWrapper.Component {...ProductShelfWrapper.props}>
<Carousel.Component
id={titleId || id}
itemsPerPage={itemsPerPageValue}
itemsPerPage={itemsPerPage}
{...Carousel.props}
>
{productEdges.map((product, idx) => (
Expand Down

0 comments on commit 152a4ac

Please sign in to comment.