diff --git a/components/design-system/CTA.jsx b/components/design-system/CTA.jsx index ed94ccc6d8..e5f2a851a9 100644 --- a/components/design-system/CTA.jsx +++ b/components/design-system/CTA.jsx @@ -9,6 +9,9 @@ export function CTA({ LinkProps, containerClass = "", }) { + // Check if body prop is HTML content + const isHTML = (str) => /<\/?[a-z][\s\S]*>/i.test(str); + return (
{body}
+ {isHTML(body) ? body :{body}
} + } + ButtonProps={{ + id: props.fragmentData.scLabsButton[0].scId, + text: + props.locale === "en" + ? props.fragmentData.scLabsButton[0].scTitleEn + : props.fragmentData.scLabsButton[0].scTitleFr, + href: + props.locale === "en" + ? props.fragmentData.scLabsButton[0].scDestinationURLEn + : props.fragmentData.scLabsButton[0].scDestinationURLFr, + className: + "w-fit bg-[#26374A] mt-4 text-white visited:text-white hover:bg-[#1C578A] hover:no-underline hover:text-white active:bg-[#16446C]", + }} + containerClass="layout-container my-4" + /> + ); +} diff --git a/components/fragment_renderer/fragment_components/Button.js b/components/fragment_renderer/fragment_components/Button.js index e9488edcb3..5b77953911 100644 --- a/components/fragment_renderer/fragment_components/Button.js +++ b/components/fragment_renderer/fragment_components/Button.js @@ -13,9 +13,9 @@ export default function Button(props) { : "primary"; return ( -- {props.locale === "en" - ? dictionary[9].scTermEn - : dictionary[9].scTermFr} -
-- {pageData.scDateModifiedOverwrite} -
-- {props.locale === "en" - ? dictionary[4].scTermEn - : dictionary[4].scTermFr} -
-- {pageData.scDateModifiedOverwrite} -
++ {props.locale === "en" + ? dictionary[9].scTermEn + : dictionary[9].scTermFr} +
++ {pageData.scDateModifiedOverwrite} +
++ {props.locale === "en" + ? dictionary[4].scTermEn + : dictionary[4].scTermFr} +
++ {pageData.scDateModifiedOverwrite} +
+