From 09aa1133a6851356cfa10733f46166a743cfeb9e Mon Sep 17 00:00:00 2001 From: Thebora Kompanioni Date: Tue, 6 Aug 2024 13:32:45 +0200 Subject: [PATCH] feat: unit and visibility toggle on main wallet view (#806) --- src/components/MainWalletView.tsx | 33 ++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/src/components/MainWalletView.tsx b/src/components/MainWalletView.tsx index 4b636c310..efadf1d18 100644 --- a/src/components/MainWalletView.tsx +++ b/src/components/MainWalletView.tsx @@ -148,18 +148,29 @@ export default function MainWalletView({ wallet }: MainWalletViewProps) { + ) : !currentWalletInfo || isLoading ? ( + + + ) : ( - settingsDispatch({ showBalance: !settings.showBalance })} className="cursor-pointer"> - {!currentWalletInfo || isLoading ? ( - - ) : ( - - )} + { + if (!settings.showBalance) { + settingsDispatch({ unit: 'BTC', showBalance: true }) + } else if (settings.unit === 'BTC') { + settingsDispatch({ unit: 'sats', showBalance: true }) + } else { + settingsDispatch({ unit: 'BTC', showBalance: false }) + } + }} + > + )}