forked from airbytehq/airbyte
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use papercups for in-app support (airbytehq#1329)
- Loading branch information
1 parent
758daaa
commit 57d9e30
Showing
8 changed files
with
690 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import React, { useEffect } from "react"; | ||
import ChatWidget from "@papercups-io/chat-widget"; | ||
import { Storytime } from "@papercups-io/storytime"; | ||
|
||
type PapercupsConfig = { | ||
accountId: string; | ||
baseUrl: string; | ||
enableStorytime: boolean; | ||
}; | ||
|
||
type IProps = { | ||
papercupsConfig: PapercupsConfig; | ||
customerId: string; | ||
}; | ||
|
||
const SupportChat: React.FC<IProps> = ({ papercupsConfig, customerId }) => { | ||
useEffect(() => { | ||
if (papercupsConfig.enableStorytime) { | ||
Storytime.init({ | ||
accountId: papercupsConfig.accountId, | ||
baseUrl: papercupsConfig.baseUrl, | ||
customer: { external_id: customerId } | ||
}); | ||
} | ||
}, [customerId, papercupsConfig]); | ||
|
||
return ( | ||
<ChatWidget | ||
title="Welcome to Airbyte" | ||
subtitle="Ask us anything in the chat window below 😊" | ||
primaryColor="#625eff" | ||
greeting="Hello!!!" | ||
newMessagePlaceholder="Start typing..." | ||
customer={{ external_id: customerId }} | ||
accountId={papercupsConfig.accountId} | ||
baseUrl={papercupsConfig.baseUrl} | ||
/> | ||
); | ||
}; | ||
|
||
export default SupportChat; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import SupportChat from "./SupportChat"; | ||
|
||
export default SupportChat; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters