Skip to content

Commit

Permalink
[DDW-614] Indicate reward amounts below 0.1 ada
Browse files Browse the repository at this point in the history
  • Loading branch information
DominikGuzei committed Jan 17, 2022
1 parent f6cb376 commit cef08d7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 22 deletions.
Expand Up @@ -94,6 +94,14 @@ export default class WalletSummaryHeader extends Component<Props> {
? '-'
: formattedWalletAmount(wallet.amount, false);

const rewardTotalAmount = reward.total.isLessThan(0.1)
? '< 0.1 ADA'
: formattedWalletAmount(reward.total, true, false, 'ADA', 1);

const rewardUnspentAmount = reward.unspent.isLessThan(0.1)
? '< 0.1 ADA'
: formattedWalletAmount(reward.unspent, true, false, 'ADA', 1);

return (
<div className={styles.component}>
<BorderedBox>
Expand All @@ -109,15 +117,7 @@ export default class WalletSummaryHeader extends Component<Props> {
<div className={styles.rewards}>
<span className={styles.rewardsAmount}>
<DiscreetValue>
{isRestoreActive
? '-'
: formattedWalletAmount(
reward.total,
true,
false,
'ADA',
1
)}
{isRestoreActive ? '-' : rewardTotalAmount}
</DiscreetValue>
</span>{' '}
{intl.formatMessage(messages.rewardsEarned)}{' '}
Expand All @@ -126,15 +126,7 @@ export default class WalletSummaryHeader extends Component<Props> {
<>
<span className={styles.rewardsAmount}>
<DiscreetValue>
{isRestoreActive
? '-'
: formattedWalletAmount(
reward.unspent,
true,
false,
'ADA',
1
)}
{isRestoreActive ? '-' : rewardUnspentAmount}
</DiscreetValue>
</span>{' '}
{intl.formatMessage(messages.rewardsUnspent)}
Expand Down
4 changes: 0 additions & 4 deletions yarn.lock
Expand Up @@ -3713,10 +3713,6 @@
version "1.0.0"
resolved "https://registry.yarnpkg.com/@types/is-function/-/is-function-1.0.0.tgz#1b0b819b1636c7baf0d6785d030d12edf70c3e83"

"@types/istanbul-lib-coverage@*":
version "2.0.4"
resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz#8467d4b3c087805d63580480890791277ce35c44"

"@types/istanbul-lib-coverage@^2.0.0", "@types/istanbul-lib-coverage@^2.0.1":
version "2.0.3"
resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz#4ba8ddb720221f432e443bd5f9117fd22cfd4762"
Expand Down

0 comments on commit cef08d7

Please sign in to comment.