-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add chatwoot, replace discord as main help link * chore: linting and tsc * chore: address review * chore: check chatwoot env variable in build script --------- Co-authored-by: jackstar12 <[email protected]> Co-authored-by: jackstar12 <[email protected]> Co-authored-by: michael1011 <[email protected]>
- Loading branch information
1 parent
ca8059f
commit 32810e6
Showing
8 changed files
with
71 additions
and
18 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
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,51 @@ | ||
import log from "loglevel"; | ||
import { onMount } from "solid-js"; | ||
|
||
import { config } from "./config"; | ||
|
||
declare global { | ||
interface Window { | ||
chatwootSettings: { | ||
darkMode: string; | ||
}; | ||
chatwootSDK: { | ||
run: (config: { websiteToken: string; baseUrl: string }) => void; | ||
}; | ||
$chatwoot: { | ||
setCustomAttributes: (attributes: { swapId: string }) => void; | ||
}; | ||
} | ||
} | ||
|
||
const Chatwoot = () => { | ||
onMount(() => { | ||
const token = import.meta.env.VITE_CHATWOOT_TOKEN; | ||
const url = config.chatwootUrl; | ||
|
||
if (token === undefined || url === undefined) { | ||
log.warn("Chatwoot URL or token not set"); | ||
return; | ||
} | ||
|
||
const tag = "script"; | ||
const script = document.createElement(tag); | ||
const parent = document.getElementsByTagName(tag)[0]; | ||
script.src = url + "/packs/js/sdk.js"; | ||
script.defer = true; | ||
script.async = true; | ||
parent.parentNode.insertBefore(script, parent); | ||
script.onload = function () { | ||
window.chatwootSettings = { | ||
darkMode: "auto", | ||
}; | ||
window.chatwootSDK.run({ | ||
websiteToken: token, | ||
baseUrl: url, | ||
}); | ||
}; | ||
}); | ||
|
||
return ""; | ||
}; | ||
|
||
export default Chatwoot; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ const defaults = { | |
|
||
loglevel: "info" as log.LogLevelDesc, | ||
defaultLanguage: "en", | ||
supportUrl: "https://support.boltz.exchange/hc/center", | ||
discordUrl: "https://discord.gg/QBvZGcW", | ||
twitterUrl: "https://twitter.com/boltzhq", | ||
githubUrl: "https://github.com/BoltzExchange", | ||
|
@@ -24,6 +25,7 @@ const defaults = { | |
telegramUrl: "https://t.me/boltzhq", | ||
email: "[email protected]", | ||
dnsOverHttps: "https://1.1.1.1/dns-query", | ||
chatwootUrl: "https://support.boltz.exchange", | ||
preimageValidation: "https://validate-payment.com", | ||
}; | ||
|
||
|
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