diff --git a/shared/editor/embeds/GoogleCalendar.tsx b/shared/editor/embeds/GoogleCalendar.tsx index 5f3b1fc11..c978f20fa 100644 --- a/shared/editor/embeds/GoogleCalendar.tsx +++ b/shared/editor/embeds/GoogleCalendar.tsx @@ -2,21 +2,14 @@ import * as React from "react"; import Frame from "../components/Frame"; import { EmbedProps as Props } from "."; -const URL_REGEX = new RegExp( - "^https?://calendar\\.google\\.com/calendar/embed\\?src=(.*)$" -); - -export default class GoogleCalendar extends React.Component { - static ENABLED = [URL_REGEX]; - - render() { - return ( - - ); - } +function GoogleCalendar(props: Props) { + return ( + + ); } + +GoogleCalendar.ENABLED = [ + new RegExp("^https?://calendar\\.google\\.com/calendar/embed\\?src=(.*)$"), +]; + +export default GoogleCalendar; diff --git a/shared/editor/embeds/GoogleDataStudio.tsx b/shared/editor/embeds/GoogleDataStudio.tsx index 0e90828df..d5816095b 100644 --- a/shared/editor/embeds/GoogleDataStudio.tsx +++ b/shared/editor/embeds/GoogleDataStudio.tsx @@ -3,30 +3,30 @@ import Frame from "../components/Frame"; import Image from "../components/Image"; import { EmbedProps as Props } from "."; -const URL_REGEX = new RegExp( - "^https?://datastudio\\.google\\.com/(embed|u/0)/reporting/(.*)/page/(.*)(/edit)?$" -); - -export default class GoogleDataStudio extends React.Component { - static ENABLED = [URL_REGEX]; - - render() { - return ( - - } - canonicalUrl={this.props.attrs.href} - title="Google Data Studio" - border - /> - ); - } +function GoogleDataStudio(props: Props) { + return ( + + } + canonicalUrl={props.attrs.href} + title="Google Data Studio" + border + /> + ); } + +GoogleDataStudio.ENABLED = [ + new RegExp( + "^https?://datastudio\\.google\\.com/(embed|u/0)/reporting/(.*)/page/(.*)(/edit)?$" + ), +]; + +export default GoogleDataStudio; diff --git a/shared/editor/embeds/GoogleDrawings.tsx b/shared/editor/embeds/GoogleDrawings.tsx index bccb892bf..34e6513ea 100644 --- a/shared/editor/embeds/GoogleDrawings.tsx +++ b/shared/editor/embeds/GoogleDrawings.tsx @@ -3,30 +3,30 @@ import Frame from "../components/Frame"; import Image from "../components/Image"; import { EmbedProps as Props } from "."; -const URL_REGEX = new RegExp( - "^https://docs\\.google\\.com/drawings/d/(.*)/(edit|preview)(.*)$" -); - -export default class GoogleDrawings extends React.Component { - static ENABLED = [URL_REGEX]; - - render() { - return ( - - } - canonicalUrl={this.props.attrs.href.replace("/preview", "/edit")} - title="Google Drawings" - border - /> - ); - } +function GoogleDrawings(props: Props) { + return ( + + } + canonicalUrl={props.attrs.href.replace("/preview", "/edit")} + title="Google Drawings" + border + /> + ); } + +GoogleDrawings.ENABLED = [ + new RegExp( + "^https://docs\\.google\\.com/drawings/d/(.*)/(edit|preview)(.*)$" + ), +]; + +export default GoogleDrawings;