@autocloud/calendly
Calendly utilities
Usage
The idea behind this package is to provide a global calendly modal to be reused.
To do this, a CalendlyProvider
context and useCalendly
hook are available.
Add the provider somewhere in your react app:
import ReactDOM from 'react-dom'
import { CalendlyProvider } from '@autocloud/calendly'
ReactDOM.render(
<CalendlyProvider>
<App />
<CalendlyProvider/>,
document.getElementById('root')
)
and then use the useCalendly
hook to show the popup
import { useCalendly } from '@autocloud/calendly'
const Dummy = () => {
const { openCalendly } = useCalendly()
return (
<button onClick={openCalendly}>Show Calendly</button>
)
}
You can passed options
prop to CalendarProvider
Defaults:
{
url = 'https://calendly.com/autocloud-team/autocloud-demo',
pageSettings = {},
prefill = {},
rootElement = document.getElementById('root'),
}
See to react-calendly as reference for pageSettings
and prefill