react-calendly
Advanced tools
Comparing version 0.0.7 to 0.0.8
@@ -1,2 +0,2 @@ | ||
import { createElement, Component, Fragment } from 'react'; | ||
import { createElement, Fragment, Component, createRef } from 'react'; | ||
@@ -65,10 +65,20 @@ /*! ***************************************************************************** | ||
__extends(InlineWidget, _super); | ||
function InlineWidget() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
function InlineWidget(props) { | ||
var _this = _super.call(this, props) || this; | ||
_this.widgetParentContainerRef = createRef(); | ||
return _this; | ||
} | ||
InlineWidget.prototype.componentDidMount = function () { | ||
loadScript(); | ||
if (!document.querySelector("script[src=\"" + CALENDLY_SCRIPT_SOURCE + "\"]")) { | ||
loadScript(); | ||
} | ||
else { | ||
window.Calendly.initInlineWidget({ | ||
url: this.props.url, | ||
parentElement: this.widgetParentContainerRef.current | ||
}); | ||
} | ||
}; | ||
InlineWidget.prototype.render = function () { | ||
return (createElement("div", { className: "calendly-inline-widget", style: this.props.styles || defaultStyles, "data-url": this.props.url })); | ||
return (createElement("div", { className: "calendly-inline-widget", style: this.props.styles || defaultStyles, "data-url": this.props.url, ref: this.widgetParentContainerRef })); | ||
}; | ||
@@ -75,0 +85,0 @@ return InlineWidget; |
@@ -69,10 +69,20 @@ 'use strict'; | ||
__extends(InlineWidget, _super); | ||
function InlineWidget() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
function InlineWidget(props) { | ||
var _this = _super.call(this, props) || this; | ||
_this.widgetParentContainerRef = React.createRef(); | ||
return _this; | ||
} | ||
InlineWidget.prototype.componentDidMount = function () { | ||
loadScript(); | ||
if (!document.querySelector("script[src=\"" + CALENDLY_SCRIPT_SOURCE + "\"]")) { | ||
loadScript(); | ||
} | ||
else { | ||
window.Calendly.initInlineWidget({ | ||
url: this.props.url, | ||
parentElement: this.widgetParentContainerRef.current | ||
}); | ||
} | ||
}; | ||
InlineWidget.prototype.render = function () { | ||
return (React.createElement("div", { className: "calendly-inline-widget", style: this.props.styles || defaultStyles, "data-url": this.props.url })); | ||
return (React.createElement("div", { className: "calendly-inline-widget", style: this.props.styles || defaultStyles, "data-url": this.props.url, ref: this.widgetParentContainerRef })); | ||
}; | ||
@@ -79,0 +89,0 @@ return InlineWidget; |
{ | ||
"name": "react-calendly", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"description": "Calendly integration for React apps", | ||
@@ -5,0 +5,0 @@ "author": "tcampb", |
import { Props as BadgeWidgetOptions } from "./components/PopupWidget/PopupWidget"; | ||
export interface ICalendly { | ||
createInlineWidgets(): void; | ||
initInlineWidget(options: { | ||
url: string; | ||
parentElement: HTMLElement; | ||
}): void; | ||
showPopupWidget(url: string): void; | ||
@@ -5,0 +8,0 @@ closePopupWidget(): void; |
@@ -7,4 +7,6 @@ import * as React from "react"; | ||
export declare class InlineWidget extends React.Component<Props> { | ||
private readonly widgetParentContainerRef; | ||
constructor(props: Props); | ||
componentDidMount(): void; | ||
render(): JSX.Element; | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
54372
349