Skip to content

Commit

Permalink
feat(connector): add general lndhub connector #576
Browse files Browse the repository at this point in the history
  • Loading branch information
escapedcat committed Sep 28, 2022
1 parent 8a3a301 commit db76098
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 8 deletions.
27 changes: 22 additions & 5 deletions src/app/router/connectorRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ import galoyBitcoinBeach from "/static/assets/icons/galoy_bitcoin_beach.png";
import galoyBitcoinJungle from "/static/assets/icons/galoy_bitcoin_jungle.png";
import lnbits from "/static/assets/icons/lnbits.png";
import lnd from "/static/assets/icons/lnd.png";
import lndhub from "/static/assets/icons/lndhub.png";
import lndhubBlueWallet from "/static/assets/icons/lndhub_bluewallet.png";
import lndhubGo from "/static/assets/icons/lndhub_go.png";
import mynode from "/static/assets/icons/mynode.png";
import raspiblitz from "/static/assets/icons/raspiblitz.png";
import start9 from "/static/assets/icons/start9.png";
Expand Down Expand Up @@ -55,14 +56,30 @@ function getConnectorRoutes() {
logo: lnd,
},
{
path: "lnd-hub",
path: "lnd-hub-bluewallet",
element: <ConnectLndHub />,
title: i18n.t("choose_connector.lndhub.title", translationI18nNamespace),
title: i18n.t(
"choose_connector.lndhub_bluewallet.title",
translationI18nNamespace
),
description: i18n.t(
"choose_connector.lndhub_bluewallet.description",
translationI18nNamespace
),
logo: lndhubBlueWallet,
},
{
path: "lnd-hub-go",
element: <ConnectLndHub lndHubType="lndhub_go" />,
title: i18n.t(
"choose_connector.lndhub_go.title",
translationI18nNamespace
),
description: i18n.t(
"choose_connector.lndhub.description",
"choose_connector.lndhub_go.description",
translationI18nNamespace
),
logo: lndhub,
logo: lndhubGo,
},
{
path: "lnbits",
Expand Down
10 changes: 8 additions & 2 deletions src/app/screens/connectors/ConnectLndHub/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,16 @@ import { useNavigate } from "react-router-dom";
import { toast } from "react-toastify";
import utils from "~/common/lib/utils";

export default function ConnectLndHub() {
export type Props = {
lndHubType?: "lndhub_bluewallet" | "lndhub_go";
};

export default function ConnectLndHub({
lndHubType = "lndhub_bluewallet",
}: Props) {
const navigate = useNavigate();
const { t } = useTranslation("translation", {
keyPrefix: "choose_connector.lndhub",
keyPrefix: `choose_connector.${lndHubType}`,
});
const [formData, setFormData] = useState({
uri: "",
Expand Down
17 changes: 16 additions & 1 deletion src/i18n/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
"connection_failed": "Connection failed. Are your LND credentials correct?"
}
},
"lndhub": {
"lndhub_bluewallet": {
"title": "LNDHub (Bluewallet)",
"description": "Connect to your Bluewallet mobile wallet",
"page": {
Expand All @@ -125,6 +125,21 @@
"connection_failed": "Connection failed. Is your LNDHub URI correct?"
}
},
"lndhub_go": {
"title": "LNDHub",
"description": "Connect to your LNDHub mobile wallet",
"page": {
"title": "Connect to LNDHub",
"description": "Input your LNDHub credential URI here or scan the QR code with your webcam."
},
"uri": {
"label": "LNDHub Export URI"
},
"errors": {
"invalid_uri": "Invalid LNDHub URI",
"connection_failed": "Connection failed. Is your LNDHub URI correct?"
}
},
"lnbits": {
"title": "LNbits",
"description": "Connect to your LNbits account",
Expand Down
File renamed without changes
Binary file added static/assets/icons/lndhub_go.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit db76098

Please sign in to comment.