Files
Charles Bergeron d50b5a7d08 * adding price for each token to contract & DApp frontend
* added 'Ownable' concept for contract (the address who deploys the contract is the owner
* clean up the getToken() info by collapsing the data from 2 calls into 1, which means only 1 call to the contract instead of 2 for each piece of data (would be huge if there were say 12 pieces of data, 1 `view` call instead of 12 to the contract
2018-05-29 12:09:21 -07:00

17 lines
350 B
React

import React, { Component } from 'react'
import PropTypes from 'prop-types'
export default class Ether extends Component {
render() {
let balance = (this.props.wei === null)
? '?'
: parseFloat(window.web3.fromWei(this.props.wei, 'ether')).toFixed(3)
return `${balance} Ξ`
}
}
Ether.propTypes = {
wei: PropTypes.string
}