-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ed4cba3
commit 170c1e3
Showing
7 changed files
with
93 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'walletd': minor | ||
--- | ||
|
||
Wallet do now shows siafund balances when greater than 0. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import { Warning16 } from '@siafoundation/react-icons' | ||
import { Panel, Separator, Text, Tooltip } from '@siafoundation/design-system' | ||
import { humanSiacoin, humanSiafund } from '@siafoundation/sia-js' | ||
import BigNumber from 'bignumber.js' | ||
import { cx } from 'class-variance-authority' | ||
|
||
export function WalletBalanceWithSf({ | ||
sc, | ||
sf, | ||
isSynced, | ||
syncingMessage, | ||
}: { | ||
sc: BigNumber | ||
sf: number | ||
isSynced: boolean | ||
syncingMessage?: string | ||
}) { | ||
const el = ( | ||
<> | ||
<Tooltip | ||
side="bottom" | ||
content={humanSiacoin(sc, { | ||
dynamicUnits: false, | ||
})} | ||
> | ||
<Text size="12" weight="semibold" className="flex items-center h-full"> | ||
{humanSiacoin(sc)} | ||
</Text> | ||
</Tooltip> | ||
{!!sf && ( | ||
<> | ||
<Separator variant="vertical" className="h-full" /> | ||
<Tooltip side="bottom" content={humanSiafund(sf)}> | ||
<Text | ||
size="12" | ||
weight="semibold" | ||
className="flex items-center h-full" | ||
> | ||
{humanSiafund(sf)} | ||
</Text> | ||
</Tooltip> | ||
</> | ||
)} | ||
</> | ||
) | ||
|
||
return ( | ||
<Panel | ||
className={cx( | ||
'hidden sm:flex h-7 items-center gap-2', | ||
!isSynced ? 'pl-2 pr-3' : 'px-3' | ||
)} | ||
> | ||
{!isSynced && ( | ||
<Tooltip | ||
side="bottom" | ||
content={ | ||
syncingMessage || 'Blockchain is syncing, balance may be incorrect.' | ||
} | ||
> | ||
<Text color="amber" className="flex items-center h-full"> | ||
<Warning16 /> | ||
</Text> | ||
</Tooltip> | ||
)} | ||
{el} | ||
</Panel> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters