mirror of
https://github.com/hanzoai/etherplate.git
synced 2026-10-30 18:37:10 +00:00
* 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
17 lines
350 B
React
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
|
|
}
|