From 36f80379dd75baeae4f39369fd6d5025b34b67b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Aaron?= Date: Wed, 20 Dec 2023 18:11:39 +0100 Subject: [PATCH 01/11] feat: new onboarding --- package.json | 1 + src/app/components/ConnectorPath/index.tsx | 16 +- src/app/components/LinkButton/index.tsx | 6 +- .../connectors/ChooseConnector/index.tsx | 42 +++--- .../connectors/ChooseConnectorPath/index.tsx | 139 +++++++++++++----- src/i18n/locales/en/translation.json | 33 ++++- static/assets/icons/voltage.png | Bin 0 -> 3643 bytes yarn.lock | 5 + 8 files changed, 166 insertions(+), 76 deletions(-) create mode 100644 static/assets/icons/voltage.png diff --git a/package.json b/package.json index ea2d6b0121..71cceb07cc 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ "@lightninglabs/lnc-web": "^0.2.4-alpha", "@noble/curves": "^1.1.0", "@noble/secp256k1": "^2.0.0", + "@popicons/react": "^0.0.8", "@scure/bip32": "^1.3.1", "@scure/bip39": "^1.2.1", "@tailwindcss/forms": "^0.5.4", diff --git a/src/app/components/ConnectorPath/index.tsx b/src/app/components/ConnectorPath/index.tsx index 8fa143c010..1e763dab2a 100644 --- a/src/app/components/ConnectorPath/index.tsx +++ b/src/app/components/ConnectorPath/index.tsx @@ -3,16 +3,18 @@ type Props = { description: string; content: React.ReactNode; actions: React.ReactNode; + icon: React.ReactNode; }; -function ConnectorPath({ title, description, content, actions }: Props) { +function ConnectorPath({ title, icon, description, content, actions }: Props) { return ( -
-

{title}

-

- {description} -

-
+
+
+ {icon} +

{title}

+
+

{description}

+
{content}
{actions}
diff --git a/src/app/components/LinkButton/index.tsx b/src/app/components/LinkButton/index.tsx index d8d19a7d05..5be3952142 100644 --- a/src/app/components/LinkButton/index.tsx +++ b/src/app/components/LinkButton/index.tsx @@ -8,9 +8,9 @@ type Props = { export default function LinkButton({ to, title, logo }: Props) { return ( - -
-
+ +
+
logo
diff --git a/src/app/screens/connectors/ChooseConnector/index.tsx b/src/app/screens/connectors/ChooseConnector/index.tsx index 9405a956ac..e209298570 100644 --- a/src/app/screens/connectors/ChooseConnector/index.tsx +++ b/src/app/screens/connectors/ChooseConnector/index.tsx @@ -14,28 +14,26 @@ export default function ChooseConnector({ }: Props) { return ( <> -
-
-
-

- {title} -

- {description && ( -

- {description} -

- )} -
-
- {connectorRoutes.map(({ path, title, logo }) => ( -
- -
- ))} -
+
+
+

+ {title} +

+ {description && ( +

+ {description} +

+ )} +
+
+ {connectorRoutes.map(({ path, title, logo }) => ( +
+ +
+ ))}
diff --git a/src/app/screens/connectors/ChooseConnectorPath/index.tsx b/src/app/screens/connectors/ChooseConnectorPath/index.tsx index 5301695f60..4b6176e600 100644 --- a/src/app/screens/connectors/ChooseConnectorPath/index.tsx +++ b/src/app/screens/connectors/ChooseConnectorPath/index.tsx @@ -1,61 +1,105 @@ +import { + PopiconsCircleCheckLine, + PopiconsCircleExclamationLine, + PopiconsCircleXLine, +} from "@popicons/react"; import { useTranslation } from "react-i18next"; import { Link } from "react-router-dom"; import Button from "~/app/components/Button"; import ConnectorPath from "~/app/components/ConnectorPath"; -import { getConnectorRoutes } from "~/app/router/connectorRoutes"; -import ConnectAlby from "~/app/screens/connectors/ConnectAlby"; -import i18n from "~/i18n/i18nConfig"; - -import alby from "/static/assets/icons/alby.png"; export default function ChooseConnectorPath() { - let connectorRoutes = getConnectorRoutes(); - - i18n.on("languageChanged", () => { - connectorRoutes = getConnectorRoutes(); - }); const { t } = useTranslation("translation", { keyPrefix: "choose_path", }); return ( -
+
-
+

+ {t("title")} +

+
+ + + + +
+ } + description={t("other.description")} content={ - logo + <> + {t("other.point1")} + {t("other.point2")} + {t("other.point3")} + {t("other.point4")} + + } + actions={ + +
); } + +const FeatureItem = ({ + type, + children, +}: { + type: "success" | "disabled" | "warning"; + children: React.ReactNode; +}) => ( +
+
+ {type == "success" && ( + + )} + {type == "disabled" && ( + + )} + {type == "warning" && ( + + )} +
+
{children}
+
+); diff --git a/src/i18n/locales/en/translation.json b/src/i18n/locales/en/translation.json index 26fc7a1d51..326d347e54 100644 --- a/src/i18n/locales/en/translation.json +++ b/src/i18n/locales/en/translation.json @@ -36,16 +36,33 @@ } }, "choose_path": { + "title": "Connect Wallet to Alby Extension", + "other": { + "title": "Bring Your Own Wallet", + "description": "Best if you already have a wallet or need to do high-volume payments.", + "connect": "Connect", + "point1": "Start instantly, no waiting for an invite", + "point2": "No transaction or volume limits", + "point3": "Both self-custody and custodial options", + "point4": "No lightning and nostr address" + }, + "voltage": { + "title": "Voltage Cloud Node", + "description": "Great If you don’t mind paying for a lightning node cloud service.", + "connect": "See Setup Guide", + "point1": "Start instantly, no waiting for an invite", + "point2": "No transaction or volume limits", + "point3": "Full self-custody and higher privacy", + "point4": "No lightning and nostr address" + }, "alby": { "title": "Alby Account", - "description": "Sign up or use your existing Alby Account. Great to quickly get started and for small amounts.", - "connect": "Connect with Alby" - }, - "other": { - "title": "Other Wallets", - "description": "Connect to your existing lightning wallet or node and choose from various connectors. Great for full flexibility. Run your own node.", - "and_more": "& more...", - "connect": "Connect" + "description": "Ideal for beginners or anyone looking for a great daily spending wallet.", + "connect": "Connect with Alby", + "point1": "You need to wait for an invite code", + "point2": "Transaction volume limits apply", + "point3": "Set up and login with your email", + "point4": "Unique lightning and nostr address" } }, "alby": { diff --git a/static/assets/icons/voltage.png b/static/assets/icons/voltage.png new file mode 100644 index 0000000000000000000000000000000000000000..93ac44568bdcfc741cec7ae4fbe4081682c72371 GIT binary patch literal 3643 zcmV-B4#e?^P)sTHfN($WZJB1$EYq>@SuYNc{igs2HbFd;`_ z;C)i|L^IEK@o{WqJVy$psgou#kA$v+y5hKXp7rhIc;-eu~=N;dc&kL}G zo`p9y(l&~Sm?V=}NB{}Gn0_YGR)8#25T|XZh=?X$CrI!)w2h+O#mEXj2nuK`AsPOW zW$Bg3wFTIEz7&?8&muhHwDoc8A2JBAg`chU`Vof<2`L2FO=SbJ!Z!u(pqYf4GtAgKX`O3UMN!kay}-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E&L*Ym4Y>>}wx0`GDY z(2XkF?LEkjH~f79IgBFV4^I9`CxDGzZUxbP+*1S=_L)<_iDSTNvZT(Rv)6gE)fMaU z79{jGG!V?8u}4n(D0R6C; Date: Wed, 20 Dec 2023 18:21:08 +0100 Subject: [PATCH 02/11] fix: links --- .../connectors/ChooseConnectorPath/index.tsx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/app/screens/connectors/ChooseConnectorPath/index.tsx b/src/app/screens/connectors/ChooseConnectorPath/index.tsx index 4b6176e600..0b8511ff55 100644 --- a/src/app/screens/connectors/ChooseConnectorPath/index.tsx +++ b/src/app/screens/connectors/ChooseConnectorPath/index.tsx @@ -7,6 +7,7 @@ import { useTranslation } from "react-i18next"; import { Link } from "react-router-dom"; import Button from "~/app/components/Button"; import ConnectorPath from "~/app/components/ConnectorPath"; +import ConnectAlby from "~/app/screens/connectors/ConnectAlby"; export default function ChooseConnectorPath() { const { t } = useTranslation("translation", { @@ -66,11 +67,16 @@ export default function ChooseConnectorPath() { {t("voltage.point1")} {t("voltage.point2")} {t("voltage.point3")} - {t("voltage.point4")} + {t("voltage.point4")} } actions={ - +
From 48c14ac40ce263219ff3273a65a50bff12901b32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Aaron?= Date: Wed, 20 Dec 2023 18:25:49 +0100 Subject: [PATCH 03/11] fix: translations & buttons --- src/app/screens/connectors/ConnectAlby/index.tsx | 2 +- src/i18n/locales/en/translation.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/screens/connectors/ConnectAlby/index.tsx b/src/app/screens/connectors/ConnectAlby/index.tsx index b0767443dd..5eadf70edf 100644 --- a/src/app/screens/connectors/ConnectAlby/index.tsx +++ b/src/app/screens/connectors/ConnectAlby/index.tsx @@ -78,8 +78,8 @@ export default function ConnectAlby() { label={t("connect")} loading={loading} disabled={loading} - primary flex + outline className="w-64" onClick={connectAlby} /> diff --git a/src/i18n/locales/en/translation.json b/src/i18n/locales/en/translation.json index 326d347e54..3259f7f2e0 100644 --- a/src/i18n/locales/en/translation.json +++ b/src/i18n/locales/en/translation.json @@ -53,7 +53,7 @@ "point1": "Start instantly, no waiting for an invite", "point2": "No transaction or volume limits", "point3": "Full self-custody and higher privacy", - "point4": "No lightning and nostr address" + "point4": "Unique lightning and nostr address" }, "alby": { "title": "Alby Account", From d68c8a2854cab589dad0e291f61412050eb9cbe1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Aaron?= Date: Wed, 20 Dec 2023 18:38:58 +0100 Subject: [PATCH 04/11] fix: remove fixed width --- src/app/screens/connectors/ConnectAlby/index.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/app/screens/connectors/ConnectAlby/index.tsx b/src/app/screens/connectors/ConnectAlby/index.tsx index 5eadf70edf..b0aeaf187e 100644 --- a/src/app/screens/connectors/ConnectAlby/index.tsx +++ b/src/app/screens/connectors/ConnectAlby/index.tsx @@ -80,7 +80,6 @@ export default function ConnectAlby() { disabled={loading} flex outline - className="w-64" onClick={connectAlby} /> ); From 73ddf78cc5e40d92e1ac165c55e5e0cd3572ff47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Aaron?= Date: Wed, 20 Dec 2023 18:53:40 +0100 Subject: [PATCH 05/11] fix: translations --- src/i18n/locales/en/translation.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/i18n/locales/en/translation.json b/src/i18n/locales/en/translation.json index 3259f7f2e0..1eea460b5c 100644 --- a/src/i18n/locales/en/translation.json +++ b/src/i18n/locales/en/translation.json @@ -48,7 +48,7 @@ }, "voltage": { "title": "Voltage Cloud Node", - "description": "Great If you don’t mind paying for a lightning node cloud service.", + "description": "Great if you don't mind paying for a lightning node cloud service.", "connect": "See Setup Guide", "point1": "Start instantly, no waiting for an invite", "point2": "No transaction or volume limits", @@ -59,7 +59,7 @@ "title": "Alby Account", "description": "Ideal for beginners or anyone looking for a great daily spending wallet.", "connect": "Connect with Alby", - "point1": "You need to wait for an invite code", + "point1": "New signups require an invite code", "point2": "Transaction volume limits apply", "point3": "Set up and login with your email", "point4": "Unique lightning and nostr address" From 044436dd8ad71a75bed3b1a6569b5af5cec13d91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Aaron?= Date: Fri, 22 Dec 2023 13:13:56 +0100 Subject: [PATCH 06/11] fix: text color --- src/app/components/ConnectorPath/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/components/ConnectorPath/index.tsx b/src/app/components/ConnectorPath/index.tsx index 1e763dab2a..8a524597f9 100644 --- a/src/app/components/ConnectorPath/index.tsx +++ b/src/app/components/ConnectorPath/index.tsx @@ -14,7 +14,7 @@ function ConnectorPath({ title, icon, description, content, actions }: Props) {

{title}

{description}

-
+
{content}
{actions}
From c206184efeea284ebc9897883f61ab61fbc1cb93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Aaron?= Date: Fri, 22 Dec 2023 13:17:12 +0100 Subject: [PATCH 07/11] fix: update link --- src/app/screens/connectors/ChooseConnectorPath/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/screens/connectors/ChooseConnectorPath/index.tsx b/src/app/screens/connectors/ChooseConnectorPath/index.tsx index 0b8511ff55..b11f7e3f57 100644 --- a/src/app/screens/connectors/ChooseConnectorPath/index.tsx +++ b/src/app/screens/connectors/ChooseConnectorPath/index.tsx @@ -72,7 +72,7 @@ export default function ChooseConnectorPath() { } actions={ Date: Fri, 22 Dec 2023 13:23:53 +0100 Subject: [PATCH 08/11] fix: connector screen --- src/app/components/LinkButton/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/components/LinkButton/index.tsx b/src/app/components/LinkButton/index.tsx index 5be3952142..10f2a50c67 100644 --- a/src/app/components/LinkButton/index.tsx +++ b/src/app/components/LinkButton/index.tsx @@ -9,7 +9,7 @@ type Props = { export default function LinkButton({ to, title, logo }: Props) { return ( -
+
logo
From cb9c09936c9a0908633bf14120106aeb5d6d2809 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Aaron?= Date: Sun, 24 Dec 2023 15:06:37 +0100 Subject: [PATCH 09/11] feat: voltage connector --- src/app/router/connectorRoutes.tsx | 15 ++ .../connectors/ChooseConnectorPath/index.tsx | 3 +- .../connectors/ConnectVoltage/index.tsx | 142 ++++++++++++++++++ src/i18n/locales/en/translation.json | 19 ++- 4 files changed, 176 insertions(+), 3 deletions(-) create mode 100644 src/app/screens/connectors/ConnectVoltage/index.tsx diff --git a/src/app/router/connectorRoutes.tsx b/src/app/router/connectorRoutes.tsx index 417770ed69..8f6989335f 100644 --- a/src/app/router/connectorRoutes.tsx +++ b/src/app/router/connectorRoutes.tsx @@ -14,6 +14,7 @@ import ConnectUmbrel from "@screens/connectors/ConnectUmbrel"; import { Route } from "react-router-dom"; import i18n from "~/i18n/i18nConfig"; +import ConnectVoltage from "~/app/screens/connectors/ConnectVoltage"; import ConnectCommando from "../screens/connectors/ConnectCommando"; import btcpay from "/static/assets/icons/btcpay.svg"; import citadel from "/static/assets/icons/citadel.png"; @@ -30,6 +31,7 @@ import mynode from "/static/assets/icons/mynode.png"; import raspiblitz from "/static/assets/icons/raspiblitz.png"; import start9 from "/static/assets/icons/start9.png"; import umbrel from "/static/assets/icons/umbrel.png"; +import voltage from "/static/assets/icons/voltage.png"; export const normalizeKey = (key: string) => key as unknown as TemplateStringsArray; @@ -95,6 +97,12 @@ const connectorMap: { [key: string]: ConnectorRoute } = { title: i18n.t("translation:choose_connector.lnd.title"), logo: lnd, }, + "voltage-lnd": { + path: "lnd", + element: , + title: i18n.t("translation:choose_connector.lnd.title"), + logo: lnd, + }, lnc: { path: "lnc", element: , @@ -149,6 +157,12 @@ const connectorMap: { [key: string]: ConnectorRoute } = { title: i18n.t("translation:choose_connector.btcpay.title"), logo: btcpay, }, + voltage: { + path: "voltage", + element: , + title: i18n.t("translation:choose_connector.voltage.title"), + logo: voltage, + }, }; function getDistribution(key: string): ConnectorRoute { @@ -228,6 +242,7 @@ function getConnectorRoutes(): ConnectorRoute[] { connectorMap["lnd-hub-go"], connectorMap["eclair"], connectorMap["btcpay"], + connectorMap["voltage"], connectorMap[galoyPaths.blink], connectorMap[galoyPaths.bitcoinJungle], getDistribution("citadel"), diff --git a/src/app/screens/connectors/ChooseConnectorPath/index.tsx b/src/app/screens/connectors/ChooseConnectorPath/index.tsx index b11f7e3f57..a8422ec440 100644 --- a/src/app/screens/connectors/ChooseConnectorPath/index.tsx +++ b/src/app/screens/connectors/ChooseConnectorPath/index.tsx @@ -72,8 +72,7 @@ export default function ChooseConnectorPath() { } actions={ diff --git a/src/app/screens/connectors/ConnectVoltage/index.tsx b/src/app/screens/connectors/ConnectVoltage/index.tsx new file mode 100644 index 0000000000..5efb843869 --- /dev/null +++ b/src/app/screens/connectors/ConnectVoltage/index.tsx @@ -0,0 +1,142 @@ +import ConnectorForm from "@components/ConnectorForm"; +import TextField from "@components/form/TextField"; +import ConnectionErrorToast from "@components/toasts/ConnectionErrorToast"; +import { useState } from "react"; +import { Trans, useTranslation } from "react-i18next"; +import { useNavigate } from "react-router-dom"; +import Hyperlink from "~/app/components/Hyperlink"; +import PasswordViewAdornment from "~/app/components/PasswordViewAdornment"; +import toast from "~/app/components/Toast"; +import msg from "~/common/lib/msg"; +import logo from "/static/assets/icons/voltage.png"; + +const initialFormData = { + url: "", + macaroon: "", +}; + +export default function ConnectVoltage() { + const navigate = useNavigate(); + const { t } = useTranslation("translation", { + keyPrefix: "choose_connector.voltage", + }); + const [formData, setFormData] = useState(initialFormData); + const [loading, setLoading] = useState(false); + const [macaroonVisible, setMacaroonVisible] = useState(false); + + function handleChange(event: React.ChangeEvent) { + setFormData({ + ...formData, + [event.target.name]: event.target.value.trim(), + }); + } + + function getConnectorType() { + return "lnd"; + } + + async function handleSubmit(event: React.FormEvent) { + event.preventDefault(); + setLoading(true); + const { url, macaroon } = formData; + const account = { + name: "LND", + config: { + macaroon, + url, + }, + connector: getConnectorType(), + }; + + try { + const validation = await msg.request("validateAccount", account); + + if (validation.valid) { + const addResult = await msg.request("addAccount", account); + if (addResult.accountId) { + await msg.request("selectAccount", { + id: addResult.accountId, + }); + navigate("/test-connection"); + } + } else { + toast.error( + , + // Don't auto-close + { duration: 100_000 } + ); + } + } catch (e) { + console.error(e); + let message = ""; + if (e instanceof Error) { + message += `${e.message}`; + } + toast.error( + + ); + } + setLoading(false); + } + + return ( + , + ]} + /> + } + logo={logo} + submitLoading={loading} + submitDisabled={formData.url === "" || formData.macaroon === ""} + onSubmit={handleSubmit} + > +
+ +
+
+ { + setMacaroonVisible(passwordView); + }} + /> + } + /> +
+
+ ); +} diff --git a/src/i18n/locales/en/translation.json b/src/i18n/locales/en/translation.json index 1eea460b5c..752610e52d 100644 --- a/src/i18n/locales/en/translation.json +++ b/src/i18n/locales/en/translation.json @@ -49,7 +49,7 @@ "voltage": { "title": "Voltage Cloud Node", "description": "Great if you don't mind paying for a lightning node cloud service.", - "connect": "See Setup Guide", + "connect": "Connect", "point1": "Start instantly, no waiting for an invite", "point2": "No transaction or volume limits", "point3": "Full self-custody and higher privacy", @@ -302,6 +302,23 @@ "errors": { "connection_failed": "Connection failed. Is your Core Lightning node online and using the commando plugin?" } + }, + "voltage": { + "title": "Voltage", + "page": { + "title": "Connect to your Voltage node", + "description": "Enterprise-grade lightning node hosting. Get on Lightning Network faster than ever. Total control with zero management. <0>Learn more" + }, + "url": { + "label": "Node URL", + "placeholder": "https://your-node.m.voltageapp.io:8080" + }, + "macaroon": { + "label": "Admin Macaroon (hex)" + }, + "errors": { + "connection_failed": "Connection failed. Are your credentials correct?" + } } }, "distributions": { From 54928441a969c795c08fe44240bbdc3f6890bf79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Aaron?= Date: Sun, 24 Dec 2023 15:09:20 +0100 Subject: [PATCH 10/11] fix: default name --- src/app/screens/connectors/ConnectVoltage/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/screens/connectors/ConnectVoltage/index.tsx b/src/app/screens/connectors/ConnectVoltage/index.tsx index 5efb843869..0ff0e11dab 100644 --- a/src/app/screens/connectors/ConnectVoltage/index.tsx +++ b/src/app/screens/connectors/ConnectVoltage/index.tsx @@ -40,7 +40,7 @@ export default function ConnectVoltage() { setLoading(true); const { url, macaroon } = formData; const account = { - name: "LND", + name: "Voltage", config: { macaroon, url, From 51a60fc9bf75b53f5d2d62d0e07112e780600185 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Aaron?= Date: Sun, 24 Dec 2023 15:16:53 +0100 Subject: [PATCH 11/11] fix: react keys --- .../connectors/ChooseConnectorPath/index.tsx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/app/screens/connectors/ChooseConnectorPath/index.tsx b/src/app/screens/connectors/ChooseConnectorPath/index.tsx index a8422ec440..87fb98ce6e 100644 --- a/src/app/screens/connectors/ChooseConnectorPath/index.tsx +++ b/src/app/screens/connectors/ChooseConnectorPath/index.tsx @@ -120,13 +120,22 @@ const FeatureItem = ({
{type == "success" && ( - + )} {type == "disabled" && ( - + )} {type == "warning" && ( - + )}
{children}