diff --git a/CHANGELOG.md b/CHANGELOG.md index fb81de56..04f338e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Fixed + +- Duplicated structured data in product search context + ## [3.133.0] - 2024-08-01 ### Added diff --git a/react/Gallery.tsx b/react/Gallery.tsx index e8ff8c3d..0e2866ac 100644 --- a/react/Gallery.tsx +++ b/react/Gallery.tsx @@ -1,5 +1,6 @@ import React, { Fragment } from 'react' import { ProductList as ProductListStructuredData } from 'vtex.structured-data' +import { useRuntime } from 'vtex.render-runtime' import GalleryLayout from './GalleryLayout' import type { GalleryLayoutProps, Slots } from './GalleryLayout' @@ -16,6 +17,10 @@ type GalleryLayoutPropsWithSlots = Omit & Slots const Gallery: React.FC< GalleryLegacyProps | GalleryLayoutPropsWithSlots > = props => { + const { + route: { routeId }, + } = useRuntime() + if ('layouts' in props && props.layouts.length > 0) { const { layouts, @@ -29,7 +34,9 @@ const Gallery: React.FC< return ( - + {!routeId.includes('store.search') && ( + + )}