From 11eb57693468bc1af329deea1294316508b887ea Mon Sep 17 00:00:00 2001 From: benalleng Date: Thu, 3 Aug 2023 10:51:55 -0400 Subject: [PATCH] feat: swap successScreen now shows balance + reserve --- src/i18n/en/translations.ts | 2 +- src/routes/Swap.tsx | 26 ++++++++++++++++++++------ 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/src/i18n/en/translations.ts b/src/i18n/en/translations.ts index 61ec870..0feb0c1 100644 --- a/src/i18n/en/translations.ts +++ b/src/i18n/en/translations.ts @@ -409,7 +409,7 @@ export default { insufficient_funds: "You don't have enough funds to make this channel", header: "Swap to Lightning", initiated: "Swap Initiated", - sats_added: "sats will be added to your Lightning balance", + sats_added: "+{{amount}} sats will be added to your Lightning balance", use_existing: "Use existing peer", choose_peer: "Choose a peer", peer_connect_label: "Connect to new peer", diff --git a/src/routes/Swap.tsx b/src/routes/Swap.tsx index 7e3eaa3..b11f352 100644 --- a/src/routes/Swap.tsx +++ b/src/routes/Swap.tsx @@ -297,16 +297,30 @@ export default function Swap() { {i18n.t("swap.initiated")}

- + - {channelOpenResult()?.channel?.balance.toLocaleString() ?? - "0"}{" "} - {i18n.t("swap.sats_added")} + {i18n.t("swap.sats_added", { + amount: ( + Number( + channelOpenResult()?.channel + ?.balance + ) + + Number( + channelOpenResult()?.channel + ?.reserve + ) + ).toLocaleString() + })}