From db47b643be87e7437eaf8487db129785bd250422 Mon Sep 17 00:00:00 2001 From: pbkompasz <47194071+pbkompasz@users.noreply.github.com> Date: Tue, 4 Oct 2022 16:35:44 +0300 Subject: [PATCH] Refactor Airtable class component to functional (#4226) --- shared/editor/embeds/Airtable.tsx | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/shared/editor/embeds/Airtable.tsx b/shared/editor/embeds/Airtable.tsx index 532c3836d..887c4f03b 100644 --- a/shared/editor/embeds/Airtable.tsx +++ b/shared/editor/embeds/Airtable.tsx @@ -4,19 +4,19 @@ import { EmbedProps as Props } from "."; const URL_REGEX = new RegExp("https://airtable.com/(?:embed/)?(shr.*)$"); -export default class Airtable extends React.Component { - static ENABLED = [URL_REGEX]; - - render() { - const { matches } = this.props.attrs; - const shareId = matches[1]; - return ( - - ); - } +function Airtable(props: Props) { + const { matches } = props.attrs; + const shareId = matches[1]; + return ( + + ); } + +Airtable.ENABLED = [URL_REGEX]; + +export default Airtable;