import React, { PureComponent } from 'react'; import CssBaseline from '@material-ui/core/CssBaseline'; import 'typeface-roboto'; import AppBar from './standard/AppBar'; import AddPoll from './simple-voting/AddPoll'; import Collapse from '@material-ui/core/Collapse'; import LinearProgress from '@material-ui/core/LinearProgress'; import { VotingContext } from '../context'; import { Route, Switch } from "react-router-dom"; import TitleScreen from './flow/TitleScreen'; import LearnAboutBallots from './flow/LearnAboutBallots'; import HowVotingWorks from './flow/HowVotingWorks'; import ConnectYourWallet from './flow/ConnectYourWallet'; import OtherWallets from './flow/OtherWallets'; import VotingCredits from './flow/VotingCredits'; import PollVoting from './flow/PollVoting'; import ReviewVotes from './flow/ReviewVotes'; import Results from './flow/Results'; class Voting extends PureComponent { state = { addPoll: false, pollTokenBalances: [], votes: [], transaction: null }; updatePollBalance = (pollId, tokenBalance, ethBalance, votes) => { const {pollTokenBalances} = this.state; pollTokenBalances[pollId] = { tokenBalance, ethBalance }; this.setState({pollTokenBalances, votes}); } setVotesToReview = (votes) => { this.setState({votes}); } setTransactionPromise = (transaction) => { this.setState({transaction}); } render(){ const { addPoll, pollTokenBalances, votes, transaction } = this.state; const togglePoll = () => { this.setState({ addPoll: !addPoll })}; return ( {({ getPolls, rawPolls, loading, symbol }) =>
{loading && }
} /> } /> } /> } /> } /> } /> } />
}
) } } export default Voting;