Files
outline/app/embeds/GoogleCalendar.js
T
2021-07-09 11:53:56 -03:00

38 lines
791 B
JavaScript

// @flow
import * as React from "react";
import Image from "components/Image";
import Frame from "./components/Frame";
const URL_REGEX = new RegExp("^https?://calendar.google.com/calendar/embed?src=(.*)$");
type Props = {|
attrs: {|
href: string,
matches: string[],
|},
|};
export default class GoogleCalendar extends React.Component<Props> {
static ENABLED = [URL_REGEX];
render() {
return (
<Frame
{...this.props}
src={this.props.attrs.href}
icon={
<Image
src="/images/google-calendar.png"
alt="Google Calendar Icon"
width={16}
height={16}
/>
}
canonicalUrl={this.props.attrs.href}
title="Google Calendar"
border
/>
);
}
}