import {Link} from "react-router-dom"; import Button from '@material-ui/core/Button'; import React, {Component, 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 Typography from '@material-ui/core/Typography'; import DialogTitle from '@material-ui/core/DialogTitle'; import Dialog from '@material-ui/core/Dialog'; import DialogActions from '@material-ui/core/DialogActions'; import DialogContent from '@material-ui/core/DialogContent'; class LearnAboutBallots extends Component { state = { open: false, dialogTitle: '', dialogText: '' }; handleClickOpen = (dialogTitle, dialogText) => { this.setState({ open: true, dialogTitle, dialogText }); }; handleClose = value => { this.setState({ open: false }); }; render(){ const {polls, idPoll} = this.props; if(!polls || !polls.length) return null; const title = polls[idPoll].content.title; const ballots = polls[idPoll].content.ballots; return (
{title} { ballots.map((item, i) => { return {item.title} {item.subtitle} }) }
); } } class BallotDialog extends Component { handleClose = () => { this.props.onClose(this.props.selectedValue); }; handleListItemClick = value => { this.props.onClose(value); }; render() { const { onClose, title, text, polls, ...other } = this.props; return ( {title} {text} ); } } export default LearnAboutBallots;