diff --git a/public/images/berrycast.png b/public/images/berrycast.png new file mode 100644 index 000000000..b123fdd87 Binary files /dev/null and b/public/images/berrycast.png differ diff --git a/shared/editor/embeds/Berrycast.tsx b/shared/editor/embeds/Berrycast.tsx new file mode 100644 index 000000000..7bee1ef24 --- /dev/null +++ b/shared/editor/embeds/Berrycast.tsx @@ -0,0 +1,27 @@ +import * as React from "react"; +import useComponentSize from "~/hooks/useComponentSize"; +import Frame from "../components/Frame"; +import { EmbedProps as Props } from "."; + +const URL_REGEX = /^https:\/\/(www\.)?berrycast.com\/conversations\/(.*)$/; + +export default function Berrycast(props: Props) { + const normalizedUrl = props.attrs.href.replace(/\/$/, ""); + const ref = React.useRef(null); + const { width } = useComponentSize(ref); + + return ( + <> +
+ + + ); +} + +Berrycast.ENABLED = [URL_REGEX]; diff --git a/shared/editor/embeds/index.tsx b/shared/editor/embeds/index.tsx index 4ac1d5a99..e6317f105 100644 --- a/shared/editor/embeds/index.tsx +++ b/shared/editor/embeds/index.tsx @@ -4,6 +4,7 @@ import { EmbedDescriptor } from "@shared/editor/types"; import Image from "../components/Image"; import Abstract from "./Abstract"; import Airtable from "./Airtable"; +import Berrycast from "./Berrycast"; import Bilibili from "./Bilibili"; import Cawemo from "./Cawemo"; import ClickUp from "./ClickUp"; @@ -86,6 +87,14 @@ const embeds: EmbedDescriptor[] = [ component: Airtable, matcher: matcher(Airtable), }, + { + title: "Berrycast", + keywords: "video", + defaultHidden: true, + icon: () => Berrycast, + component: Berrycast, + matcher: matcher(Berrycast), + }, { title: "Bilibili", keywords: "video",