Skip to content

Commit

Permalink
[DEV-1402] update banner link (#657)
Browse files Browse the repository at this point in the history
* update banner link

* changeset

* Update apps/nextjs-website/src/editorialComponents/BannerLink/BannerLink.tsx

Co-authored-by: Marco Ponchia <[email protected]>

* Update apps/nextjs-website/src/editorialComponents/BannerLink/BannerLink.tsx

fix lint

---------

Co-authored-by: Marco Ponchia <[email protected]>
  • Loading branch information
tommaso1 and MarcoPonchia authored Feb 16, 2024
1 parent e99ffd4 commit c58c050
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/little-boats-think.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"nextjs-website": patch
---

Fix link visualization
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ export const BannerLink = (props: BannerLinkProps) => {
const backgroundColor =
theme === 'dark' ? palette.primary.dark : palette.primary.light;

const bodyElement =
typeof body === 'string' ? (
<div dangerouslySetInnerHTML={{ __html: DOMPurify.sanitize(body) }} />
) : (
body
);

const textColor = palette.primary.contrastText;
return (
<Box bgcolor={backgroundColor} component='section' sx={{ width: '100%' }}>
Expand All @@ -41,8 +48,7 @@ export const BannerLink = (props: BannerLinkProps) => {
},
}}
>
{/* Purify the body if it is a string or show the Element */}
{typeof body === 'string' ? DOMPurify.sanitize(body) : body}
{bodyElement}
</Typography>
</Stack>
</Stack>
Expand Down

0 comments on commit c58c050

Please sign in to comment.