2022-04-25 04:33:00 +00:00
|
|
|
import { useEffect } from "react";
|
|
|
|
import { useState } from "react";
|
2022-03-31 08:45:47 +00:00
|
|
|
import ReactDom from "react-dom";
|
|
|
|
|
2022-04-25 04:33:00 +00:00
|
|
|
import Cal from "./src/index";
|
2022-03-31 08:45:47 +00:00
|
|
|
|
|
|
|
function App() {
|
2022-04-25 04:33:00 +00:00
|
|
|
const [loaded, setLoaded] = useState(false);
|
|
|
|
useEffect(() => {
|
|
|
|
// Simulate state change causing config object to change, causing rerender of Cal
|
|
|
|
setTimeout(setLoaded.bind(true), 1000);
|
|
|
|
}, []);
|
2022-03-31 08:45:47 +00:00
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<h1>
|
|
|
|
There is <code>Cal</code> component below me
|
|
|
|
</h1>
|
|
|
|
<Cal
|
2022-04-14 02:47:34 +00:00
|
|
|
calOrigin="http://localhost:3000"
|
2022-04-25 04:33:00 +00:00
|
|
|
embedJsUrl="//localhost:3100/dist/embed.umd.js"
|
2022-03-31 08:45:47 +00:00
|
|
|
calLink="pro"
|
|
|
|
config={{
|
|
|
|
name: "John Doe",
|
|
|
|
email: "johndoe@gmail.com",
|
|
|
|
notes: "Test Meeting",
|
|
|
|
guests: ["janedoe@gmail.com"],
|
|
|
|
theme: "dark",
|
|
|
|
}}></Cal>
|
2022-04-08 05:33:24 +00:00
|
|
|
<button data-cal-link="pro">Popup</button>
|
2022-03-31 08:45:47 +00:00
|
|
|
</>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
ReactDom.render(<App></App>, document.getElementById("root"));
|