From 245b25dc384fba250768b375f392cb7e994d254a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hampus=20Sj=C3=B6berg?= Date: Thu, 29 Apr 2021 21:14:53 +0200 Subject: [PATCH] Donation: Add lightning node --- config/config.ts_TEMPLATE | 3 +++ frontend/components/Donation.tsx | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/config/config.ts_TEMPLATE b/config/config.ts_TEMPLATE index 0e4a218..38939be 100644 --- a/config/config.ts_TEMPLATE +++ b/config/config.ts_TEMPLATE @@ -45,6 +45,8 @@ interface Config { cert: string; // Path to invoice.macaroon macaroon: string; + // Lightning Node URI @ + lightningNodeUri?: string; }; // URL to the LNURL-pay endpoint lnurlPayUrl: string; @@ -78,6 +80,7 @@ const config: Config = { // server: "https://127.0.0.1:8080", // cert: "/path/to/tls.cert", // macaroon: "/path/to/invoice.macaroon", + // lightningNodeUri: "pubkey@ip:port" // }, // }, // lnurlPayUrl: "https://domain.com/invoice", diff --git a/frontend/components/Donation.tsx b/frontend/components/Donation.tsx index 6f423b9..51c775d 100644 --- a/frontend/components/Donation.tsx +++ b/frontend/components/Donation.tsx @@ -46,6 +46,23 @@ export const ChangeToBolt11 = styled.a` font-size: 14px; `; +export const ConnectToNodeTitle = styled.p` + display: block; + overflow-wrap: anywhere; + font-size: 12px; + color: #aaa; + margin-top: 17px; + margin-bottom: 4px; +`; + +export const ConnectToNodeData = styled.p` + display: block; + overflow-wrap: anywhere; + font-size: 12px; + color: #aaa; + margin-top: 0; +`; + const lnurlPayBech32 = bech32.encode( "lnurl", bech32.toWords(new TextEncoder().encode(config.donation?.lnurlPayUrl)), @@ -115,6 +132,12 @@ export function Donation() { Unsupported wallet? Click to change to normal BOLT11 invoice )} + {config.donation?.data.lightningNodeUri && ( + <> + The Lightning Node: + {config.donation.data.lightningNodeUri} + + )} )}