diff --git a/blocks/article-body-block/chains/article-body/default.jsx b/blocks/article-body-block/chains/article-body/default.jsx index 8421c80829..75f9b9bba2 100644 --- a/blocks/article-body-block/chains/article-body/default.jsx +++ b/blocks/article-body-block/chains/article-body/default.jsx @@ -34,6 +34,28 @@ const StyledLink = styled.a` color: ${(props) => props.primaryColor}; `; +const InterstitialLink = ({ key, url, content, arcSite, phrases }) => { + // link string will have to be truthy (non-zero length string) to render below + if (!(url && content)) return null; + const beforeContent = "[ "; + const afterContent = " ]"; + + return ( + +

+ + + +

+
+ ); +}; + function parseArticleItem(item, index, arcSite, phrases, id, customFields) { const { _id: key = index, type, content } = item; @@ -177,25 +199,14 @@ function parseArticleItem(item, index, arcSite, phrases, id, customFields) { } case "interstitial_link": { - const { url } = item; - // link string will have to be truthy (non-zero length string) to render below - if (!(url && content)) return null; - const beforeContent = "[ "; - const afterContent = " ]"; - return ( - -

- - - -

-
+ ); } @@ -248,6 +259,17 @@ function parseArticleItem(item, index, arcSite, phrases, id, customFields) { ) : null; case "oembed_response": { + if (item.subtype === "twitter" && !item?.raw_oembed?.html?.includes(item?.raw_oembed?.url)) { + return ( + + ); + } return item.raw_oembed ? : null; }