Create and use printableCoins
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import HashView from "./HashView";
|
||||
import StackableContainer from "../layout/StackableContainer";
|
||||
import { printableCoin } from "../../lib/displayHelpers";
|
||||
import { printableCoins } from "../../lib/displayHelpers";
|
||||
|
||||
export default (props) => (
|
||||
<StackableContainer lessPadding lessMargin>
|
||||
@@ -8,7 +8,7 @@ export default (props) => (
|
||||
{props.tx.msgs && (
|
||||
<li>
|
||||
<label>Amount:</label>
|
||||
<div>{printableCoin(props.tx.msgs[0].value.amount[0])}</div>
|
||||
<div>{printableCoins(props.tx.msgs[0].value.amount)}</div>
|
||||
</li>
|
||||
)}
|
||||
{props.tx.msgs && (
|
||||
|
||||
@@ -33,4 +33,11 @@ const printableCoin = (coin) => {
|
||||
}
|
||||
}
|
||||
|
||||
export { abbreviateLongString, printableCoin };
|
||||
const printableCoins = (coins) => {
|
||||
if (coins.length !== 1) {
|
||||
throw new Error("Implementation only supports exactly one coin entry.")
|
||||
}
|
||||
return printableCoin(coins[0]);
|
||||
}
|
||||
|
||||
export { abbreviateLongString, printableCoin, printableCoins };
|
||||
|
||||
Reference in New Issue
Block a user