From 56297fb988b3bc44c74fc63132bcc8f1cbd8f148 Mon Sep 17 00:00:00 2001 From: Barry Gitarts Date: Wed, 27 Jun 2018 12:32:11 -0400 Subject: [PATCH] add pollsList --- app/components/Voting.js | 4 +++- app/components/simple-voting/PollsList.js | 27 +++++++++++++++++++++++ app/dapp.js | 6 +++-- 3 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 app/components/simple-voting/PollsList.js diff --git a/app/components/Voting.js b/app/components/Voting.js index b027028..7bfe37a 100644 --- a/app/components/Voting.js +++ b/app/components/Voting.js @@ -3,11 +3,13 @@ import CssBaseline from '@material-ui/core/CssBaseline'; import 'typeface-roboto'; import AppBar from './standard/AppBar'; import AddPoll from './simple-voting/AddPoll'; +import PollsList from './simple-voting/PollsList'; -export default ({ toggleAdmin }) => ( +export default ({ toggleAdmin, rawPolls }) => ( + {rawPolls && } ) diff --git a/app/components/simple-voting/PollsList.js b/app/components/simple-voting/PollsList.js new file mode 100644 index 0000000..c2b0958 --- /dev/null +++ b/app/components/simple-voting/PollsList.js @@ -0,0 +1,27 @@ +import React, { Fragment } from 'react'; +import Card from '@material-ui/core/Card'; +import CardContent from '@material-ui/core/CardContent'; +import Button from '@material-ui/core/Button'; +import Typography from '@material-ui/core/Typography'; + +const Poll = ({ _question, _totalCensus, _voters }) => ( + + + Proposal: {_question} + + Total SNT Voted: {_totalCensus} + + + Number of voters: {_voters} + + + +) + +const PollsList = ({ rawPolls }) => ( + + {rawPolls.map(poll => )} + +) + +export default PollsList diff --git a/app/dapp.js b/app/dapp.js index 22c00ab..39e275f 100644 --- a/app/dapp.js +++ b/app/dapp.js @@ -51,11 +51,13 @@ class App extends React.Component { } render(){ - const { admin } = this.state; + const { admin, rawPolls } = this.state; const toggleAdmin = () => this.setState({ admin: true }); return ( - {admin ? : } + {admin ? + : + } ); }