Functional Component Refactor: Figma, Framer, Gist (#4260)

This commit is contained in:
mastqe
2022-10-15 10:01:10 -04:00
committed by GitHub
parent 4dc336eeab
commit 42d866931b
3 changed files with 54 additions and 67 deletions

View File

@@ -2,19 +2,12 @@ import * as React from "react";
import Frame from "../components/Frame";
import { EmbedProps as Props } from ".";
const URL_REGEX = new RegExp("^https://framer.cloud/(.*)$");
export default class Framer extends React.Component<Props> {
static ENABLED = [URL_REGEX];
render() {
return (
<Frame
{...this.props}
src={this.props.attrs.href}
title="Framer Embed"
border
/>
);
}
function Framer(props: Props) {
return (
<Frame {...props} src={props.attrs.href} title="Framer Embed" border />
);
}
Framer.ENABLED = [new RegExp("^https://framer.cloud/(.*)$")];
export default Framer;