@@ -52,6 +52,8 @@ const Infobar = ({
5252 LinkComponent,
5353} : InfobarProps ) => {
5454 const simplifiedLayout = getTailwindVariantLayout ( layout )
55+ const hasPrimaryCTA = ! ! buttonLabel && ! ! buttonUrl
56+ const hasSecondaryCTA = ! ! secondaryButtonLabel && ! ! secondaryButtonUrl
5557
5658 return (
5759 < section >
@@ -83,42 +85,44 @@ const Infobar = ({
8385 ) }
8486 </ div >
8587
86- < div
87- className = { compoundStyles . buttonContainer ( {
88- layout : simplifiedLayout ,
89- } ) }
90- >
91- { buttonLabel && buttonUrl && (
92- < LinkButton
93- href = { getReferenceLinkHref (
94- buttonUrl ,
95- site . siteMap ,
96- site . assetsBaseUrl ,
97- ) }
98- size = { simplifiedLayout === "homepage" ? "lg" : "base" }
99- LinkComponent = { LinkComponent }
100- isWithFocusVisibleHighlight
101- >
102- { buttonLabel }
103- </ LinkButton >
104- ) }
88+ { ( hasPrimaryCTA || hasSecondaryCTA ) && (
89+ < div
90+ className = { compoundStyles . buttonContainer ( {
91+ layout : simplifiedLayout ,
92+ } ) }
93+ >
94+ { hasPrimaryCTA && (
95+ < LinkButton
96+ href = { getReferenceLinkHref (
97+ buttonUrl ,
98+ site . siteMap ,
99+ site . assetsBaseUrl ,
100+ ) }
101+ size = { simplifiedLayout === "homepage" ? "lg" : "base" }
102+ LinkComponent = { LinkComponent }
103+ isWithFocusVisibleHighlight
104+ >
105+ { buttonLabel }
106+ </ LinkButton >
107+ ) }
105108
106- { secondaryButtonLabel && secondaryButtonUrl && (
107- < LinkButton
108- href = { getReferenceLinkHref (
109- secondaryButtonUrl ,
110- site . siteMap ,
111- site . assetsBaseUrl ,
112- ) }
113- size = { simplifiedLayout === "homepage" ? "lg" : "base" }
114- variant = "outline"
115- LinkComponent = { LinkComponent }
116- isWithFocusVisibleHighlight
117- >
118- { secondaryButtonLabel }
119- </ LinkButton >
120- ) }
121- </ div >
109+ { hasSecondaryCTA && (
110+ < LinkButton
111+ href = { getReferenceLinkHref (
112+ secondaryButtonUrl ,
113+ site . siteMap ,
114+ site . assetsBaseUrl ,
115+ ) }
116+ size = { simplifiedLayout === "homepage" ? "lg" : "base" }
117+ variant = "outline"
118+ LinkComponent = { LinkComponent }
119+ isWithFocusVisibleHighlight
120+ >
121+ { secondaryButtonLabel }
122+ </ LinkButton >
123+ ) }
124+ </ div >
125+ ) }
122126 </ div >
123127 </ div >
124128 </ section >
0 commit comments