Skip to content

Commit 2b28e83

Browse files
committed
Add hubspot example and readme
1 parent 379a600 commit 2b28e83

3 files changed

Lines changed: 72 additions & 1 deletion

File tree

README.md

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ You can pass the following props to the `LiveChatLoaderProvider` provider:
132132

133133
## 💬 Supported Providers
134134

135-
Currently there are six supported providers:
135+
Currently there are seven supported providers:
136136

137137
<details>
138138
<summary id="help-scout">Help Scout</summary>
@@ -347,6 +347,39 @@ You can customise the Chatwoot placeholder by passing the following props to the
347347

348348
</details>
349349

350+
<details>
351+
<summary id="hubspot">Hubspot</summary>
352+
353+
To use Hubspot import the `LiveChatLoaderProvider` and set the `provider` prop
354+
as `hubSpot` and the `providerKey` prop as your Hubspot API Key.
355+
356+
Then import the `Hubspot` component.
357+
358+
```jsx
359+
import { LiveChatLoaderProvider, Hubspot } from 'react-live-chat-loader'
360+
361+
export default class App extends React.Component {
362+
render() {
363+
return (
364+
<LiveChatLoaderProvider providerKey="asdjkasl123123" provider="hubspot">
365+
/* ... */
366+
<Hubspot />
367+
</LiveChatLoaderProvider>
368+
)
369+
}
370+
}
371+
```
372+
373+
You can customise the Hubspot placeholder by passing the following props to the
374+
`Hubspot` component:
375+
376+
- `backgroundColor`: The background color of the placeholder
377+
- `loader`: A react component shown while the Hubspot libraries are loading
378+
379+
</details>
380+
381+
<details>
382+
350383
## ➕ Adding a Provider
351384

352385
To add a new live chat provider, follow the steps in [Contributing: Adding a Provider](CONTRIBUTING.md#-adding-a-provider).

website/components/exampleLinks.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ const ExampleLinks = () => (
3333
<a>Chatwoot</a>
3434
</Link>
3535
</li>
36+
<li>
37+
<Link href="/hubspot">
38+
<a>HubSpot</a>
39+
</Link>
40+
</li>
3641
</ul>
3742
)
3843

website/pages/hubspot.tsx

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import React from 'react'
2+
import { LiveChatLoaderProvider, HubSpot } from 'react-live-chat-loader'
3+
import type { NextPage } from 'next'
4+
5+
import Layout from '../layouts/main'
6+
import ExampleLinks from '../components/exampleLinks'
7+
8+
const Page: NextPage = () => (
9+
<LiveChatLoaderProvider
10+
provider="hubSpot"
11+
providerKey=""
12+
>
13+
<Layout title="React Live Chat Loader: Hubspot">
14+
<div className="wrapper">
15+
<div className="inner">
16+
<h1>React Live Chat Loader: Hubspot</h1>
17+
<p>
18+
This is an example implementation of the Hubspot widget using{' '}
19+
<a href="https://github.com/calibreapp/react-live-chat-loader">
20+
react-live-chat-loader
21+
</a>
22+
.
23+
</p>
24+
<p>View other demos:</p>
25+
<ExampleLinks />
26+
</div>
27+
</div>
28+
<HubSpot backgroundColor='#017848'/>
29+
</Layout>
30+
</LiveChatLoaderProvider>
31+
)
32+
33+
export default Page

0 commit comments

Comments
 (0)