Embed behind authentication page, Floating Button Popup and other changes (#2468)

Co-authored-by: Omar López <[email protected]>
This commit is contained in:
Hariom BalharaandOmar López authored and GitHub committed 2022-04-14 08:17:34 +05:30
1 parent ce476bf90f
commit 39935306fc
20 files changed
+559 -152

No files matched your search

+13 -3
View File
@@ -4,9 +4,11 @@ import useEmbed from "./useEmbed";
export default function Cal({
calLink,
calOrigin,
config,
embedJsUrl,
}: {
calOrigin?: string;
calLink: string;
config?: any;
embedJsUrl?: string;
@@ -17,13 +19,21 @@ export default function Cal({
if (!Cal) {
return;
}
Cal("init");
const element = ref.current;
let initConfig = {};
if (calOrigin) {
(initConfig as any).origin = calOrigin;
}
Cal("init", initConfig);
Cal("inline", {
elementOrSelector: ref.current,
elementOrSelector: element,
calLink,
config,
});
}, [Cal, calLink, config]);
return () => {
element?.querySelector(".cal-embed")?.remove();
};
}, [Cal, calLink, config, calOrigin]);
if (!Cal) {
return <div>Loading {calLink}</div>;
+1
View File
@@ -9,6 +9,7 @@ function App() {
There is <code>Cal</code> component below me
</h1>
<Cal
calOrigin="http://localhost:3000"
embedJsUrl="//localhost:3002/dist/embed.umd.js"
calLink="pro"
config={{