diff --git a/app/components/Voting.js b/app/components/Voting.js index 3f0abbc..b027028 100644 --- a/app/components/Voting.js +++ b/app/components/Voting.js @@ -2,10 +2,12 @@ import React, { Fragment } from 'react'; import CssBaseline from '@material-ui/core/CssBaseline'; import 'typeface-roboto'; import AppBar from './standard/AppBar'; +import AddPoll from './simple-voting/AddPoll'; export default ({ toggleAdmin }) => ( + ) diff --git a/app/components/simple-voting/AddPoll.js b/app/components/simple-voting/AddPoll.js new file mode 100644 index 0000000..d62c220 --- /dev/null +++ b/app/components/simple-voting/AddPoll.js @@ -0,0 +1,72 @@ +import React, { Fragment } from 'react'; +import Card from '@material-ui/core/Card'; +import CardActions from '@material-ui/core/CardActions'; +import CardContent from '@material-ui/core/CardContent'; +import PollManager from 'Embark/contracts/PollManager'; +import TextField from '@material-ui/core/TextField'; +import Button from '@material-ui/core/Button'; +import { withStyles } from '@material-ui/core/styles'; +import { withFormik } from 'formik'; + +const styles = theme => ({ + button: { + margin: theme.spacing.unit, + }, + extendedIcon: { + marginRight: theme.spacing.unit, + }, + textField: { + marginLeft: theme.spacing.unit, + marginRight: theme.spacing.unit + }, + inputLabel: { + fontSize: '16px' + }, + form: { + display: 'flex', + flexDirection: 'column' + } +}); + +const InnerForm = ({ + values, + errors, + touched, + handleChange, + handleBlur, + handleSubmit, + isSubmitting, + classes +}) => ( + + +
+ + + +
+
+) + +const StyledForm = withStyles(styles)(InnerForm); +const AddPoll = withFormik({ + mapPropsToValues: props => ({ description: ''}), + validate(values){ + const errors = {}; + return errors; + }, + handleSubmit(values) { + + } +})(StyledForm) + +export default AddPoll;