mirror of
https://github.com/trezor/trezor-wallet
synced 2025-04-08 19:36:16 +00:00
review
This commit is contained in:
parent
35892652a8
commit
de0b2afde1
@ -2,6 +2,7 @@
|
||||
|
||||
import * as React from 'react';
|
||||
import Notification from 'components/Notification';
|
||||
import Bignumber from 'bignumber.js';
|
||||
|
||||
import type { Props } from '../../index';
|
||||
|
||||
@ -14,13 +15,16 @@ export default (props: Props) => {
|
||||
if (!location || !selectedAccount || !account) return null;
|
||||
|
||||
// Ripple minimum reserve notification
|
||||
if (location.pathname.includes('xrp') && parseInt(account.balance, 10) < 20) {
|
||||
const { reserve, balance } = account;
|
||||
const bigBalance = new Bignumber(balance);
|
||||
const bigReserve = new Bignumber(reserve);
|
||||
if (location.pathname.includes('xrp') && bigBalance.lessThan(bigReserve)) {
|
||||
notifications.push(
|
||||
<Notification
|
||||
key="xrp-warning"
|
||||
type="warning"
|
||||
title="Minimum account reserve required"
|
||||
message="The Base Reserve is a minimum amount of XRP that is required for every address in the ledger. Currently, this is 20 XRP."
|
||||
message={`The Base Reserve is a minimum amount of XRP that is required for every address in the ledger. Currently, this is ${account.reserve.toString()} XRP.`}
|
||||
/>,
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user