import {Link} from "react-router-dom"; import Button from '@material-ui/core/Button'; import React, {Component} from 'react'; import Typography from '@material-ui/core/Typography' import Card from '@material-ui/core/Card'; import CardContent from '@material-ui/core/CardContent'; import { withRouter } from 'react-router-dom' class VotingCredits extends Component { componentDidMount(){ const {polls, balances, history} = this.props; if(!polls || !balances || !polls.length || !balances.length){ history.push('/'); } } render(){ const {polls, balances, history} = this.props; if(!polls || !balances) return null; let title = polls[0].content.title; let description = polls[0].content.description; let ethBalance = web3.utils.fromWei(balances[0].ethBalance, "ether"); let tokenBalance = Math.floor(web3.utils.fromWei(balances[0].tokenBalance, "ether")); return (polls ?