chore: tweak dashboard modal displays

This commit is contained in:
kieran 2024-10-10 21:38:50 +01:00
parent cbb745eebe
commit 2e789b222c
No known key found for this signature in database
GPG Key ID: DE71CEB3925BE941
3 changed files with 39 additions and 20 deletions

View File

@ -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;
@ -174,6 +178,18 @@ export default function NostrProviderDialog({
)}
{ep && <StreamKey ep={ep} />}
<div>
<p className="pb-2">
<FormattedMessage defaultMessage="Features" id="ZXp0z1" />
</p>
<div className="flex gap-2">{ep?.capabilities?.map(a => <Pill>{parseCapability(a)}</Pill>)}</div>
</div>
</>
);
}
function currentBalance() {
if (!info) return;
return <div>
<p>
<FormattedMessage defaultMessage="Balance" id="H5+NAX" />
</p>
@ -188,18 +204,16 @@ export default function NostrProviderDialog({
<AccountTopup provider={provider} onFinish={loadInfo} />
<AccountWithdrawl provider={provider} onFinish={loadInfo} />
</div>
</div>
}
function balanceTimeEstimate() {
if (!info) return;
return <div>
<small>
<FormattedMessage defaultMessage="About {estimate}" id="Q3au2v" values={{ estimate: calcEstimate() }} />
<FormattedMessage defaultMessage="About {estimate}" values={{ estimate: calcEstimate() }} />
</small>
</div>
<div>
<p className="pb-2">
<FormattedMessage defaultMessage="Features" id="ZXp0z1" />
</p>
<div className="flex gap-2">{ep?.capabilities?.map(a => <Pill>{parseCapability(a)}</Pill>)}</div>
</div>
</>
);
}
function streamEditor() {
@ -274,6 +288,8 @@ export default function NostrProviderDialog({
return (
<>
{showEndpoints && streamEndpoints()}
{showBalance&& currentBalance()}
{showEstimate && balanceTimeEstimate()}
{streamEditor()}
{forwardInputs()}
{balanceHist()}

View File

@ -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}
/>

View File

@ -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}