feat: Add 'Pitch' embed support
This commit is contained in:
parent
b616292fce
commit
33524a1322
BIN
public/images/pitch.png
Normal file
BIN
public/images/pitch.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 29 KiB |
31
shared/embeds/Pitch.js
Normal file
31
shared/embeds/Pitch.js
Normal 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"
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
@ -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",
|
||||
|
Reference in New Issue
Block a user