diff --git a/shared/editor/embeds/GoogleDocs.tsx b/shared/editor/embeds/GoogleDocs.tsx index e23d540ac..05e04fc4b 100644 --- a/shared/editor/embeds/GoogleDocs.tsx +++ b/shared/editor/embeds/GoogleDocs.tsx @@ -3,28 +3,28 @@ import Frame from "../components/Frame"; import Image from "../components/Image"; import { EmbedProps as Props } from "."; -const URL_REGEX = new RegExp("^https?://docs\\.google\\.com/document/(.*)$"); - -export default class GoogleDocs extends React.Component { - static ENABLED = [URL_REGEX]; - - render() { - return ( - - } - canonicalUrl={this.props.attrs.href} - title="Google Docs" - border - /> - ); - } +function GoogleDocs(props: Props) { + return ( + + } + canonicalUrl={props.attrs.href} + title="Google Docs" + border + /> + ); } + +GoogleDocs.ENABLED = [ + new RegExp("^https?://docs\\.google\\.com/document/(.*)$"), +]; + +export default GoogleDocs; diff --git a/shared/editor/embeds/GoogleDrive.tsx b/shared/editor/embeds/GoogleDrive.tsx index 0c7cdcc84..59627a56d 100644 --- a/shared/editor/embeds/GoogleDrive.tsx +++ b/shared/editor/embeds/GoogleDrive.tsx @@ -3,27 +3,27 @@ import Frame from "../components/Frame"; import Image from "../components/Image"; import { EmbedProps as Props } from "."; -const URL_REGEX = new RegExp("^https?://drive\\.google\\.com/file/d/(.*)$"); - -export default class GoogleDrive extends React.Component { - static ENABLED = [URL_REGEX]; - - render() { - return ( - - } - title="Google Drive" - canonicalUrl={this.props.attrs.href} - border - /> - ); - } +function GoogleDrive(props: Props) { + return ( + + } + title="Google Drive" + canonicalUrl={props.attrs.href} + border + /> + ); } + +GoogleDrive.ENABLED = [ + new RegExp("^https?://drive\\.google\\.com/file/d/(.*)$"), +]; + +export default GoogleDrive; diff --git a/shared/editor/embeds/GoogleSheets.tsx b/shared/editor/embeds/GoogleSheets.tsx index 1376124a8..5a7873111 100644 --- a/shared/editor/embeds/GoogleSheets.tsx +++ b/shared/editor/embeds/GoogleSheets.tsx @@ -3,30 +3,28 @@ import Frame from "../components/Frame"; import Image from "../components/Image"; import { EmbedProps as Props } from "."; -const URL_REGEX = new RegExp( - "^https?://docs\\.google\\.com/spreadsheets/d/(.*)$" -); - -export default class GoogleSheets extends React.Component { - static ENABLED = [URL_REGEX]; - - render() { - return ( - - } - canonicalUrl={this.props.attrs.href} - title="Google Sheets" - border - /> - ); - } +function GoogleSheets(props: Props) { + return ( + + } + canonicalUrl={props.attrs.href} + title="Google Sheets" + border + /> + ); } + +GoogleSheets.ENABLED = [ + new RegExp("^https?://docs\\.google\\.com/spreadsheets/d/(.*)$"), +]; + +export default GoogleSheets; diff --git a/shared/editor/embeds/GoogleSlides.tsx b/shared/editor/embeds/GoogleSlides.tsx index 78d4c02d7..d1614e29d 100644 --- a/shared/editor/embeds/GoogleSlides.tsx +++ b/shared/editor/embeds/GoogleSlides.tsx @@ -3,32 +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/presentation/d/(.*)$" -); - -export default class GoogleSlides extends React.Component { - static ENABLED = [URL_REGEX]; - - render() { - return ( - - } - canonicalUrl={this.props.attrs.href} - title="Google Slides" - border - /> - ); - } +function GoogleSlides(props: Props) { + return ( + + } + canonicalUrl={props.attrs.href} + title="Google Slides" + border + /> + ); } + +GoogleSlides.ENABLED = [ + new RegExp("^https?://docs\\.google\\.com/presentation/d/(.*)$"), +]; + +export default GoogleSlides;