Skip to content

Commit

Permalink
feat: add chatwoot, replace discord as main help link
Browse files Browse the repository at this point in the history
  • Loading branch information
kilrau authored and jackstar12 committed Nov 27, 2024
1 parent 93464ac commit d3933f4
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 19 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ We encourage our technical users to check the code and run the web app locally f

## Resources

* Get Help: [Discord](https://discord.gg/QBvZGcW) | [Telegram](https://t.me/boltzhq)
* Get Help: [Support Center](https://support.boltz.exchange/hc/center/) | [Discord](https://discord.gg/QBvZGcW) | [Telegram](https://t.me/boltzhq)
* Read the Docs: [Docs Home](https://docs.boltz.exchange/)
* Read our Blog: [Substack](https://blog.boltz.exchange/)
* Follow us: [X/Twitter](https://twitter.com/Boltzhq) | [Nostr](https://snort.social/p/npub1psm37hke2pmxzdzraqe3cjmqs28dv77da74pdx8mtn5a0vegtlas9q8970)
Expand Down
43 changes: 43 additions & 0 deletions src/chatwoot.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import { config } from "./config";
import { usePayContext } from "./context/Pay";
import { createEffect, onMount } from "solid-js";

export default function Chatwoot() {
onMount(() => {
const token = import.meta.env.VITE_CHATWOOT_TOKEN;
const url = config.chatwootUrl;
if (token !== undefined && url !== undefined) {
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
});
};
}
});

try {
const { swap } = usePayContext();

createEffect(() => {
if (swap() !== null) {
window.$chatwoot.setCustomAttributes({
id: swap().id
});
}
});
} catch (error) {

Check failure on line 39 in src/chatwoot.ts

View workflow job for this annotation

GitHub Actions / ci

'error' is defined but never used

Check failure on line 39 in src/chatwoot.ts

View workflow job for this annotation

GitHub Actions / ci

Empty block statement

Check failure on line 39 in src/chatwoot.ts

View workflow job for this annotation

GitHub Actions / ci

'error' is defined but never used

Check failure on line 39 in src/chatwoot.ts

View workflow job for this annotation

GitHub Actions / ci

Empty block statement
}

return "";
}
14 changes: 4 additions & 10 deletions src/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,6 @@ const Footer = () => {

return (
<footer>
<h4>
{t("feedback")}{" "}
<a
title="Discord"
class="discord"
target="_blank"
href={config.discordUrl}>
Discord
</a>
</h4>
<div class="socials">
<a
title="Github"
Expand Down Expand Up @@ -79,6 +69,10 @@ const Footer = () => {
</a>
</div>
<p class="footer-nav">
<a target="_blank" href={config.supportUrl}>
{t("support")}
</a>{" "}
|{" "}
<a target="_blank" href={config.blogUrl}>
{t("blog")}
</a>{" "}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const Nav = (props: { network: string }) => {
<a
class="external"
target="_blank"
href={config.discordUrl}>
href={config.supportUrl}>
{t("help")}
<OcLinkexternal2 size={23} />
</a>
Expand Down
2 changes: 2 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
};

type Asset = {
Expand Down
12 changes: 6 additions & 6 deletions src/i18n/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ const dict = {
en: {
language: "English",
status: "Status",
feedback: "Got Feedback? Join our",
fast: "Fast",
l2: "Built on Layer 2",
l2_sub: "Boltz utilizes Layer 2 scaling technologies like the Lightning Network",
Expand All @@ -21,6 +20,7 @@ const dict = {
channel: "Channel",
refund: "Refund",
blog: "Blog",
support: "Support",
documentation: "Docs",
onion: "Onion",
blockexplorer: "open {{ typeLabel }}",
Expand Down Expand Up @@ -225,7 +225,6 @@ const dict = {
de: {
language: "Deutsch",
status: "Status",
feedback: "Feedback? Schreib uns auf",
fast: "Schnell",
l2: "Auf Layer-2 gebaut",
l2_sub: "Boltz nutzt Layer-2 Skalierungstechnologien wie das Lightning-Netzwerk",
Expand All @@ -245,6 +244,7 @@ const dict = {
channel: "Kanal",
refund: "Rückerstattung",
blog: "Blog",
support: "Hilfe",
documentation: "Docs",
onion: "Onion",
blockexplorer: "{{ typeLabel }} anzeigen",
Expand Down Expand Up @@ -458,7 +458,6 @@ const dict = {
es: {
language: "Español",
status: "Estado",
feedback: "¿Tienes comentarios? Únete a nuestro",
fast: "Rápido",
l2: "Construido en la Capa 2",
l2_sub: "Boltz utiliza tecnologías de segunda capa como la red de Lightning",
Expand All @@ -477,6 +476,7 @@ const dict = {
channel: "Canal",
refund: "Reembolso",
blog: "Blog",
support: "Ayuda",
documentation: "Docs",
onion: "Onion",
blockexplorer: "Ver en {{ typeLabel }}",
Expand Down Expand Up @@ -689,7 +689,6 @@ const dict = {
zh: {
language: "中文",
status: "状态",
feedback: "有反馈?加入我们的",
fast: "快速",
l2: "建立在二层网络之上",
l2_sub: "Boltz利用像闪电网络这样的二层网络扩展技术",
Expand All @@ -708,14 +707,15 @@ const dict = {
channel: "通道",
refund: "退款",
blog: "博客",
support: "支持",
documentation: "文档",
onion: "洋葱",
blockexplorer: "打开{{ typeLabel }}",
blockexplorer_lockup_address: "锁仓地址",
blockexplorer_lockup_tx: "锁仓交易",
blockexplorer_claim_tx: "索赔交易",
blockexplorer_refund_tx: "退款交易",
help: "帮助",
help: "支持",
network_fee: "网络费",
fee: "Boltz费",
denomination: "面额",
Expand Down Expand Up @@ -893,7 +893,6 @@ const dict = {
ja: {
language: "日本語",
status: "ステータス",
feedback: "フィードバックはこちらへ",
fast: "高速",
l2: "L2技術を活用",
l2_sub: "Boltzは、LiquidネットワークやLightningネットワークなどのL2スケーリング技術を利用しています",
Expand All @@ -912,6 +911,7 @@ const dict = {
channel: "チャネル",
refund: "返金",
blog: "ブログ",
support: "ヘルプ",
documentation: "ドキュメント",
onion: "Onion",
blockexplorer: "ブロックエクスプローラーで表示{{ typeLabel }}",
Expand Down
2 changes: 2 additions & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import RefundEvm from "./pages/RefundEvm";
import RefundStep from "./pages/RefundStep";
import "./style/index.scss";
import "./utils/patches";
import Chatwoot from "./chatwoot";

if ("serviceWorker" in navigator) {
void navigator.serviceWorker
Expand Down Expand Up @@ -67,6 +68,7 @@ const App = (props: RouteSectionProps) => {
<CreateProvider>
<PayProvider>
<SwapChecker />
<Chatwoot />
<Show when={!isEmbedded()}>
<Nav network={config.network} />
</Show>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Pay.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useParams } from "@solidjs/router";
import log from "loglevel";
import { Match, Show, Switch, createResource, onCleanup } from "solid-js";
import { Match, Show, Switch, createResource, onCleanup, createSignal } from "solid-js";

Check failure on line 3 in src/pages/Pay.tsx

View workflow job for this annotation

GitHub Actions / ci

'createSignal' is defined but never used

Check failure on line 3 in src/pages/Pay.tsx

View workflow job for this annotation

GitHub Actions / ci

'createSignal' is defined but never used

import BlockExplorerLink from "../components/BlockExplorerLink";
import LoadingSpinner from "../components/LoadingSpinner";
Expand Down

0 comments on commit d3933f4

Please sign in to comment.