diff --git a/site/components/Paragraph.js b/site/components/Paragraph.js index 3940a5d..c3e985d 100644 --- a/site/components/Paragraph.js +++ b/site/components/Paragraph.js @@ -1,15 +1,21 @@ import LiteYouTubeEmbed from "react-lite-youtube-embed"; -import { YOUTUBE_REGEX } from "../lib/constants"; +import TwitterEmbed from "./TwitterEmbed"; +import { YOUTUBE_REGEX, TWITTER_REGEX } from "../lib/constants"; export const Paragraph = (props) => { if ( typeof props.children == "object" && props.children.props && - props.children.props.href && - YOUTUBE_REGEX.test(props.children.props.href) + props.children.props.href ) { - const youtubeId = props.children.props.href.split(/^|=|\//).pop(); - return ; + if (YOUTUBE_REGEX.test(props.children.props.href)) { + const youtubeId = props.children.props.href.split(/^|=|\//).pop(); + return ; + } + + if (TWITTER_REGEX.test(props.children.props.href)) { + return ; + } } return

; };