From 641257bdc2e1aac809aa6f20abd5c8988b777f70 Mon Sep 17 00:00:00 2001 From: Roland Bewick Date: Wed, 10 Jul 2024 22:16:17 +0700 Subject: [PATCH] feat: improve open channel ui - re-add primary open channel button - add links to increase receiving capacity from outgoing and channel order pages --- frontend/src/screens/channels/Channels.tsx | 4 +- .../screens/channels/CurrentChannelOrder.tsx | 5 ++ .../channels/IncreaseOutgoingCapacity.tsx | 88 +++---------------- 3 files changed, 20 insertions(+), 77 deletions(-) diff --git a/frontend/src/screens/channels/Channels.tsx b/frontend/src/screens/channels/Channels.tsx index 8f4c3f03..1356a7a7 100644 --- a/frontend/src/screens/channels/Channels.tsx +++ b/frontend/src/screens/channels/Channels.tsx @@ -363,9 +363,9 @@ export default function Channels() { - {/* + - */} + diff --git a/frontend/src/screens/channels/CurrentChannelOrder.tsx b/frontend/src/screens/channels/CurrentChannelOrder.tsx index 47149a5e..a18f5ce2 100644 --- a/frontend/src/screens/channels/CurrentChannelOrder.tsx +++ b/frontend/src/screens/channels/CurrentChannelOrder.tsx @@ -356,6 +356,11 @@ function PayBitcoinChannelOrderTopup({ order }: { order: NewChannelOrder }) { Topup with your credit card or bank account + + + ); diff --git a/frontend/src/screens/channels/IncreaseOutgoingCapacity.tsx b/frontend/src/screens/channels/IncreaseOutgoingCapacity.tsx index 5e578b8e..242f478b 100644 --- a/frontend/src/screens/channels/IncreaseOutgoingCapacity.tsx +++ b/frontend/src/screens/channels/IncreaseOutgoingCapacity.tsx @@ -1,4 +1,4 @@ -import { Box, ChevronDown, Zap } from "lucide-react"; +import { ChevronDown } from "lucide-react"; import React, { FormEvent } from "react"; import { Link, useNavigate } from "react-router-dom"; import AppHeader from "src/components/AppHeader"; @@ -78,21 +78,13 @@ function NewChannelInternal({ network }: { network: Network }) { return _channelPeerSuggestions ? [ ..._channelPeerSuggestions.filter( - (peer) => - peer.paymentMethod !== "lightning" || peer.lspType !== "LSPS1" + (peer) => peer.paymentMethod !== "lightning" ), customOption, ] : undefined; }, [_channelPeerSuggestions, network]); - function setPaymentMethod(paymentMethod: "onchain" | "lightning") { - setOrder((current) => ({ - ...current, - paymentMethod, - })); - } - function setPublic(isPublic: boolean) { setOrder((current) => ({ ...current, @@ -131,21 +123,9 @@ function NewChannelInternal({ network }: { network: Network }) { host: selectedPeer.host, })); } - if ( - selectedPeer.paymentMethod === "lightning" && - order.paymentMethod === "lightning" - ) { - setOrder((current) => ({ - ...current, - lspType: selectedPeer.lspType, - lspUrl: selectedPeer.lspUrl, - })); - } } }, [order.paymentMethod, selectedPeer]); - const selectedCardStyles = "border-primary border-2 font-medium"; - const [showAdvanced, setShowAdvanced] = React.useState(false); function onSubmit(e: FormEvent) { @@ -219,6 +199,15 @@ function NewChannelInternal({ network }: { network: Network }) { + + + + + } />
{showAdvanced && ( <> -
- -
- setPaymentMethod("onchain")} - className="flex-1" - > -
- - Onchain -
- - setPaymentMethod("lightning")}> -
- - Lightning -
- -
-
{selectedPeer && - (selectedPeer.paymentMethod === "lightning" || - (order.paymentMethod === "onchain" && - selectedPeer.pubkey === order.pubkey)) && ( + order.paymentMethod === "onchain" && + selectedPeer.pubkey === order.pubkey && (