Display 0x00..00 as null (#3950)

* Display 0x00..00 as null (custom black icon)

* rendering test for null
This commit is contained in:
Jaco Greeff
2016-12-22 18:30:59 +01:00
committed by Gav Wood
parent f0387c33c6
commit 077069c452
5 changed files with 43 additions and 15 deletions

View File

@@ -14,6 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import BigNumber from 'bignumber.js';
import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
@@ -62,6 +63,7 @@ class InputAddress extends Component {
classes.push(!icon ? styles.inputEmpty : styles.input);
const containerClasses = [ styles.container ];
const nullName = new BigNumber(value).eq(0) ? 'null' : null;
if (small) {
containerClasses.push(styles.small);
@@ -82,7 +84,7 @@ class InputAddress extends Component {
value={
text && account
? account.name
: value
: (nullName || value)
} />
{ icon }
</div>