feat: Add 'Pitch' embed support

This commit is contained in:
Tom Moor 2021-11-14 18:33:30 -08:00
parent b616292fce
commit 33524a1322
3 changed files with 40 additions and 0 deletions

BIN
public/images/pitch.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

31
shared/embeds/Pitch.js Normal file
View File

@ -0,0 +1,31 @@
// @flow
import * as React from "react";
import Frame from "./components/Frame";
const URL_REGEX = new RegExp(
"^https?://app.pitch.com/app/(?:presentation/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|public/player)/(.*)$"
);
type Props = {|
attrs: {|
href: string,
matches: any,
|},
|};
export default class Pitch extends React.Component<Props> {
static ENABLED = [URL_REGEX];
render() {
const shareId = this.props.attrs.matches[1];
return (
<Frame
{...this.props}
src={`https://pitch.com/embed/${shareId}`}
title="Pitch Embed"
height="414px"
/>
);
}
}

View File

@ -26,6 +26,7 @@ import Marvel from "./Marvel";
import Mindmeister from "./Mindmeister";
import Miro from "./Miro";
import ModeAnalytics from "./ModeAnalytics";
import Pitch from "./Pitch";
import Prezi from "./Prezi";
import Spotify from "./Spotify";
import Trello from "./Trello";
@ -232,6 +233,14 @@ export default [
component: ModeAnalytics,
matcher: matcher(ModeAnalytics),
},
{
title: "Pitch",
keywords: "presentation",
defaultHidden: true,
icon: () => <Img src="/images/pitch.png" />,
component: Pitch,
matcher: matcher(Pitch),
},
{
title: "Prezi",
keywords: "presentation",