@coverdash/single-quote
v0.0.9
Published
Coverdash single quote component for partner integrations
Downloads
832
Keywords
Readme
@coverdash/single-quote
Coverdash Single Quote Component for partner integrations. This component displays a single insurance quote with an opt-in button for HousecallPro and other partner integrations.
Installation
npm install @coverdash/single-quote
# or
yarn add @coverdash/single-quoteUsage
import SingleQuoteComponent from "@coverdash/single-quote"
import "@coverdash/single-quote/lib/cjs/styles.css"
function App() {
return (
<SingleQuoteComponent
env="uat" // or "production" or "staging"
applicationId="your-application-id"
onContinueClicked={(requiresUwq) => {
console.log(
"Continue clicked, requires underwriting questions:",
requiresUwq
)
}}
onClose={() => {
console.log("Component closed")
}}
/>
)
}Props
applicationId(required): The application ID to display the quote forenv: Environment to use ("production", "uat", or "staging")styles: Custom CSS styles for the iframe containerallowScroll: Whether to allow scrolling in the iframehideChat: Hide the chat widgetautoResize: Automatically resize the iframe based on contentsource: Source identifier for trackinghideScrollbar: Hide the scrollbaronContinueClicked: Callback when the continue button is clicked, returns whether underwriting questions are requiredonClose: Callback when the component is closed
Development
# Install dependencies
yarn
# Start the example app
cd example
yarn
yarn start
# Build the package
yarn buildPublishing
The package is published to npm via GitLab CI when pushing to the release_prod branch.
Build Process
The build process uses the copy-files script to copy components from example/src/components to src/components before building. This allows you to develop in the example app and have changes automatically copied to the package.
