feat: Allow Google Embeds from regular (non publish-to-web) links (#1533)

Improve styling to allow getting back to source document
This commit is contained in:
Tom Moor
2020-09-15 18:38:42 -07:00
committed by GitHub
parent b3b71d2dc7
commit ac8f0ebaac
8 changed files with 118 additions and 31 deletions

View File

@@ -2,9 +2,7 @@
import * as React from "react";
import Frame from "./components/Frame";
const URL_REGEX = new RegExp(
"^https?://docs.google.com/presentation/d/(.*)/pub(.*)$"
);
const URL_REGEX = new RegExp("^https?://docs.google.com/presentation/d/(.*)$");
type Props = {|
attrs: {|
@@ -19,8 +17,19 @@ export default class GoogleSlides extends React.Component<Props> {
render() {
return (
<Frame
src={this.props.attrs.href.replace("/pub", "/embed")}
title="Google Slides Embed"
src={this.props.attrs.href
.replace("/edit", "/preview")
.replace("/pub", "/embed")}
icon={
<img
src="/images/google-slides.png"
alt="Google Slides Icon"
width={16}
height={16}
/>
}
canonicalUrl={this.props.attrs.href}
title="Google Slides"
border
/>
);