diff --git a/.changeset/shy-chicken-pull.md b/.changeset/shy-chicken-pull.md new file mode 100644 index 0000000000..a56f5a24c8 --- /dev/null +++ b/.changeset/shy-chicken-pull.md @@ -0,0 +1,5 @@ +--- +"@graphcommerce/demo-magento-graphcommerce": patch +--- + +Make sure the DemoRecentlyViewedProducts doesn't render without any items diff --git a/packages/demo-magento-graphcommerce/plugins/demo/DemoRecentlyViewedProducts.tsx b/packages/demo-magento-graphcommerce/plugins/demo/DemoRecentlyViewedProducts.tsx index 19f1d39d78..56f8f56ab7 100644 --- a/packages/demo-magento-graphcommerce/plugins/demo/DemoRecentlyViewedProducts.tsx +++ b/packages/demo-magento-graphcommerce/plugins/demo/DemoRecentlyViewedProducts.tsx @@ -44,19 +44,21 @@ function DemoRecentlyViewedProducts(props: PluginProps - - {title}}> - {filterNonNullableKeys(items).map((item) => ( - - ))} - - + {items.length > 0 && ( + + {title}}> + {filterNonNullableKeys(items).map((item) => ( + + ))} + + + )} ) }