Skip to content
This repository was archived by the owner on Jan 22, 2018. It is now read-only.

Commit 5cf1dbd

Browse files
authored
Use TokenValue to format tokens (#19)
1 parent f198307 commit 5cf1dbd

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

src/MethodDecoding/methodDecoding.js

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import { connect } from 'react-redux';
2323

2424
import { TypedInput, InputAddress } from '../Form';
2525
import Loading from '../Loading';
26+
import TokenValue from './tokenValue';
2627
import MethodDecodingStore from './methodDecodingStore';
2728

2829
import { ASCII_INPUT, TOKEN_METHODS } from './constants';
@@ -334,7 +335,7 @@ class MethodDecoding extends Component {
334335
}
335336

336337
renderTokenAction () {
337-
const { historic } = this.props;
338+
const { historic, token } = this.props;
338339
const { methodSignature, methodInputs } = this.state;
339340
const [to, value] = methodInputs;
340341
const address = to.value;
@@ -351,7 +352,11 @@ class MethodDecoding extends Component {
351352
historic,
352353
value: (
353354
<span className={styles.highlight}>
354-
{ this.renderTokenValue(value.value) }
355+
<TokenValue
356+
id={token.id}
357+
token={token}
358+
value={value.value}
359+
/>
355360
</span>
356361
),
357362
address: this.renderAddressName(address)
@@ -595,16 +600,6 @@ class MethodDecoding extends Component {
595600
return inputs;
596601
}
597602

598-
renderTokenValue (value) {
599-
const { token } = this.props;
600-
601-
return (
602-
<span className={styles.tokenValue}>
603-
{ value.div(token.format).toFormat(5) }<small> { token.tag }</small>
604-
</span>
605-
);
606-
}
607-
608603
renderEtherValue (value) {
609604
const { api } = this.context;
610605
const ether = api.util.fromWei(value);

0 commit comments

Comments
 (0)