From 2e789b222c86e2fa5c5f73b545a17976a1b0df40 Mon Sep 17 00:00:00 2001 From: kieran Date: Thu, 10 Oct 2024 21:38:50 +0100 Subject: [PATCH] chore: tweak dashboard modal displays --- src/element/provider/nostr/index.tsx | 54 ++++++++++++++++--------- src/pages/dashboard/balance-history.tsx | 3 +- src/pages/dashboard/button-settings.tsx | 2 + 3 files changed, 39 insertions(+), 20 deletions(-) diff --git a/src/element/provider/nostr/index.tsx b/src/element/provider/nostr/index.tsx index 174a8a6..84a028a 100644 --- a/src/element/provider/nostr/index.tsx +++ b/src/element/provider/nostr/index.tsx @@ -20,6 +20,8 @@ export default function NostrProviderDialog({ provider, showEndpoints, showEditor, + showBalance, + showEstimate, showForwards, showBalanceHistory, showStreamKeys, @@ -27,6 +29,8 @@ export default function NostrProviderDialog({ }: { provider: NostrStreamProvider; showEndpoints: boolean; + showBalance?: boolean; + showEstimate?: boolean; showEditor: boolean; showForwards: boolean; showBalanceHistory: boolean; @@ -173,25 +177,6 @@ export default function NostrProviderDialog({ )} {ep && } -
-

- -

-
-
- -
- - -
- - - -

@@ -202,6 +187,35 @@ export default function NostrProviderDialog({ ); } + function currentBalance() { + if (!info) return; + return

+

+ +

+
+
+ +
+ + +
+
+ } + + function balanceTimeEstimate() { + if (!info) return; + return
+ + + +
+ } + function streamEditor() { if (!info || !showEditor) return; if (info.tosAccepted === false) { @@ -274,6 +288,8 @@ export default function NostrProviderDialog({ return ( <> {showEndpoints && streamEndpoints()} + {showBalance&& currentBalance()} + {showEstimate && balanceTimeEstimate()} {streamEditor()} {forwardInputs()} {balanceHist()} diff --git a/src/pages/dashboard/balance-history.tsx b/src/pages/dashboard/balance-history.tsx index 6025c6d..7afea7d 100644 --- a/src/pages/dashboard/balance-history.tsx +++ b/src/pages/dashboard/balance-history.tsx @@ -17,8 +17,9 @@ export default function BalanceHistoryModal({ provider }: { provider: NostrStrea diff --git a/src/pages/dashboard/button-settings.tsx b/src/pages/dashboard/button-settings.tsx index 3243efa..cff6fb9 100644 --- a/src/pages/dashboard/button-settings.tsx +++ b/src/pages/dashboard/button-settings.tsx @@ -22,6 +22,8 @@ export function DashboardSettingsButton({ ev }: { ev?: TaggedNostrEvent }) { provider={provider} ev={ev} showEndpoints={true} + showBalance={true} + showEstimate={true} showForwards={true} showEditor={false} showBalanceHistory={false}