File tree Expand file tree Collapse file tree 2 files changed +36
-12
lines changed
dotcom-rendering/src/components Expand file tree Collapse file tree 2 files changed +36
-12
lines changed Original file line number Diff line number Diff line change @@ -349,6 +349,39 @@ export const withoutHeading: StoryFn = () => {
349349 ) ;
350350} ;
351351
352+ export const emptyHeadingsOnly : StoryFn = ( ) => {
353+ return (
354+ < >
355+ < ProductElement
356+ product = { {
357+ ...product ,
358+ primaryHeading : '' ,
359+ secondaryHeading : 'Secondary heading only' ,
360+ } }
361+ format = { {
362+ design : ArticleDesign . Review ,
363+ display : ArticleDisplay . Showcase ,
364+ theme : Pillar . Lifestyle ,
365+ } }
366+ ArticleElementComponent = { ArticleElementComponent }
367+ />
368+ < ProductElement
369+ product = { {
370+ ...product ,
371+ primaryHeading : 'Primary Heading' ,
372+ secondaryHeading : '' ,
373+ } }
374+ format = { {
375+ design : ArticleDesign . Review ,
376+ display : ArticleDisplay . Showcase ,
377+ theme : Pillar . Lifestyle ,
378+ } }
379+ ArticleElementComponent = { ArticleElementComponent }
380+ />
381+ </ >
382+ ) ;
383+ } ;
384+
352385export const displayTypeProductCardOnly : StoryFn = ( ) => {
353386 return (
354387 < >
Original file line number Diff line number Diff line change @@ -58,18 +58,9 @@ export const ProductElement = ({
5858 format : ArticleFormat ;
5959} ) => {
6060 const subheadingHtml = parseHtml (
61- [
62- product . primaryHeading
63- ? `<h2 id="${ product . h2Id ?? product . elementId } -primary">${
64- product . primaryHeading
65- } </h2>`
66- : '' ,
67- product . secondaryHeading
68- ? `<h2 id="${ product . h2Id ?? product . elementId } -secondary">${
69- product . secondaryHeading
70- } </h2>`
71- : '' ,
72- ] . join ( '' ) ,
61+ `<h2 id="${ product . h2Id ?? product . elementId } ">${
62+ product . primaryHeading ? `${ product . primaryHeading } </br>` : ''
63+ } ${ product . secondaryHeading || '' } </h2>`,
7364 ) ;
7465
7566 const isSubheading = subheadingHtml . textContent
You can’t perform that action at this time.
0 commit comments