Skip to content

Commit

Permalink
Added AddProductsToCartForm to DemoRecentlyViewedProducts
Browse files Browse the repository at this point in the history
  • Loading branch information
Jessevdpoel committed Jan 5, 2024
1 parent 345a78d commit f559b13
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
12 changes: 5 additions & 7 deletions examples/magento-graphcms/pages/p/[url].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,11 @@ function ProductPage(props: Props) {
}}
/>
)}
<AddProductsToCartForm>
<RecentlyViewedProducts
title={<Trans id='Recently viewed products' />}
exclude={[product.sku]}
productListRenderer={productListRenderer}
/>
</AddProductsToCartForm>
<RecentlyViewedProducts
title={<Trans id='Recently viewed products' />}
exclude={[product.sku]}
productListRenderer={productListRenderer}
/>
</>
)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { AddProductsToCartForm } from '@graphcommerce/magento-product'
import {
useRecentlyViewedProducts,
useRecentlyViewedSkus,
Expand Down Expand Up @@ -41,17 +42,19 @@ function DemoRecentlyViewedProducts(props: PluginProps<RecentlyViewedProductsPro
return (
<>
<div ref={ref} />
<SidebarSlider sidebar={<Typography variant='h2'>{title}</Typography>}>
{filterNonNullableKeys([...loadingProducts, ...productList.products]).map((item) => (
<RenderType
key={item.uid ?? ''}
renderer={productListRenderer}
sizes={responsiveVal(200, 400)}
titleComponent='h3'
{...item}
/>
))}
</SidebarSlider>
<AddProductsToCartForm>
<SidebarSlider sidebar={<Typography variant='h2'>{title}</Typography>}>
{filterNonNullableKeys([...loadingProducts, ...productList.products]).map((item) => (
<RenderType
key={item.uid ?? ''}
renderer={productListRenderer}
sizes={responsiveVal(200, 400)}
titleComponent='h3'
{...item}
/>
))}
</SidebarSlider>
</AddProductsToCartForm>
</>
)
}
Expand Down

0 comments on commit f559b13

Please sign in to comment.