chore: tweak dashboard modal displays
This commit is contained in:
parent
cbb745eebe
commit
2e789b222c
@ -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({
|
||||
</div>
|
||||
)}
|
||||
{ep && <StreamKey ep={ep} />}
|
||||
<div>
|
||||
<p>
|
||||
<FormattedMessage defaultMessage="Balance" id="H5+NAX" />
|
||||
</p>
|
||||
<div className="flex gap-2">
|
||||
<div className="bg-layer-2 rounded-xl w-full flex items-center px-3">
|
||||
<FormattedMessage
|
||||
defaultMessage="{amount} sats"
|
||||
id="vrTOHJ"
|
||||
values={{ amount: info.balance?.toLocaleString() }}
|
||||
/>
|
||||
</div>
|
||||
<AccountTopup provider={provider} onFinish={loadInfo} />
|
||||
<AccountWithdrawl provider={provider} onFinish={loadInfo} />
|
||||
</div>
|
||||
<small>
|
||||
<FormattedMessage defaultMessage="About {estimate}" id="Q3au2v" values={{ estimate: calcEstimate() }} />
|
||||
</small>
|
||||
</div>
|
||||
<div>
|
||||
<p className="pb-2">
|
||||
<FormattedMessage defaultMessage="Features" id="ZXp0z1" />
|
||||
@ -202,6 +187,35 @@ export default function NostrProviderDialog({
|
||||
);
|
||||
}
|
||||
|
||||
function currentBalance() {
|
||||
if (!info) return;
|
||||
return <div>
|
||||
<p>
|
||||
<FormattedMessage defaultMessage="Balance" id="H5+NAX" />
|
||||
</p>
|
||||
<div className="flex gap-2">
|
||||
<div className="bg-layer-2 rounded-xl w-full flex items-center px-3">
|
||||
<FormattedMessage
|
||||
defaultMessage="{amount} sats"
|
||||
id="vrTOHJ"
|
||||
values={{ amount: info.balance?.toLocaleString() }}
|
||||
/>
|
||||
</div>
|
||||
<AccountTopup provider={provider} onFinish={loadInfo} />
|
||||
<AccountWithdrawl provider={provider} onFinish={loadInfo} />
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
function balanceTimeEstimate() {
|
||||
if (!info) return;
|
||||
return <div>
|
||||
<small>
|
||||
<FormattedMessage defaultMessage="About {estimate}" values={{ estimate: calcEstimate() }} />
|
||||
</small>
|
||||
</div>
|
||||
}
|
||||
|
||||
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()}
|
||||
|
@ -17,8 +17,9 @@ export default function BalanceHistoryModal({ provider }: { provider: NostrStrea
|
||||
<NostrProviderDialog
|
||||
provider={provider}
|
||||
showBalanceHistory={true}
|
||||
showBalance={true}
|
||||
showEditor={false}
|
||||
showEndpoints={true}
|
||||
showEndpoints={false}
|
||||
showForwards={false}
|
||||
showStreamKeys={false}
|
||||
/>
|
||||
|
@ -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}
|
||||
|
Loading…
x
Reference in New Issue
Block a user