@@ -14,6 +14,7 @@ import Breadcrumbs from '@storystore/ui/dist/components/Breadcrumbs'
14
14
import PageBuilder from '~/components/PageBuilder'
15
15
import useHtml from '~/hooks/useHtml'
16
16
import { OtherProducts } from './OtherProducts'
17
+ import { isPageBuilderHtml } from '../PageBuilder/lib/utils'
17
18
18
19
const SimpleProduct = dynamic ( ( ) => import ( './ProductTypes/SimpleProduct' ) )
19
20
const GroupedProduct = dynamic ( ( ) => import ( './ProductTypes/GroupedProduct' ) )
@@ -132,6 +133,8 @@ export const Product: FunctionComponent<QueryResult> = ({ loading, data }) => {
132
133
)
133
134
}
134
135
136
+ const isDescriptionPageBuilder = product ?. description ?. html ? isPageBuilderHtml ( product . description . html ) : false
137
+
135
138
return (
136
139
< ProductContext . Provider value = { { setPrice : handleUpdatePrice , setGallery : handleUpdateGallery } } >
137
140
{ product && < Head title = { product . metaTitle || product . title } description = { product . metaDescription } keywords = { product . metaKeywords } /> }
@@ -191,15 +194,17 @@ export const Product: FunctionComponent<QueryResult> = ({ loading, data }) => {
191
194
{ /* TODO: ... */ }
192
195
{ product . type === 'GiftCard' && < GiftCard { ...product } /> }
193
196
194
- { product . descriptionContainer === 'container1' && product ?. description ?. html && < Description as = { PageBuilder } html = { product . description . html } /> }
197
+ { ( product . descriptionContainer === 'container1' || ! isDescriptionPageBuilder ) && product ?. description ?. html && (
198
+ < Description as = { PageBuilder } html = { product . description . html } />
199
+ ) }
195
200
</ React . Fragment >
196
201
) }
197
202
</ Info >
198
203
</ InfoInnerWrapper >
199
204
</ InfoWrapper >
200
205
</ Wrapper >
201
206
202
- { product ?. descriptionContainer === 'container2' && product ?. description ?. html && < Description as = { PageBuilder } html = { product . description . html } /> }
207
+ { product ?. descriptionContainer === 'container2' && isDescriptionPageBuilder && product ?. description ?. html && < Description as = { PageBuilder } html = { product . description . html } /> }
203
208
204
209
{ product ?. urlKey && < OtherProducts urlKey = { product . urlKey } /> }
205
210
</ Root >
0 commit comments