1
0
mirror of https://github.com/trezor/trezor-wallet synced 2025-01-01 03:40:53 +00:00

rewrite static notification condition (xrp || txrp)

This commit is contained in:
Szymon Lesisz 2019-01-09 18:03:41 +01:00 committed by Szymon Lesisz
parent 2c24b75d47
commit 3ebce65093

View File

@ -15,18 +15,20 @@ export default (props: Props) => {
if (!location || !selectedAccount || !account) return null; if (!location || !selectedAccount || !account) return null;
// Ripple minimum reserve notification // Ripple minimum reserve notification
const { reserve, balance } = account; if (account.networkType === 'ripple') {
const bigBalance = new Bignumber(balance); const { reserve, balance } = account;
const bigReserve = new Bignumber(reserve); const bigBalance = new Bignumber(balance);
if (location.pathname.includes('xrp') && (bigBalance.lessThan(bigReserve) || bigBalance.lessThanOrEqualTo(new Bignumber(0)))) { const bigReserve = new Bignumber(reserve);
notifications.push( if (bigBalance.lessThan(bigReserve)) {
<Notification notifications.push(
key="xrp-warning" <Notification
type="warning" key="xrp-warning"
title="Minimum account reserve required" type="warning"
message={`The Base Reserve is a minimum amount of XRP that is required for every address in the ledger. Currently, this is ${bigReserve.toString()} XRP.`} 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 ${bigReserve.toString()} XRP.`}
); />,
);
}
} }
return ( return (