import React from 'react' import { Query } from 'react-apollo' import { Button, Dialog, DialogContent, DialogContentText, DialogTitle } from '@material-ui/core' import { withStyles } from '@material-ui/core/styles' import styles from './styles' import { hostedEventsCalls } from '../GraphQL/Calls/index' import New from './New' import Event from './Event' class HostedEvent extends React.Component { constructor (props) { super(props) this.state = { isNewEventOpen: false } } handleNewEvent = (event) => { this.props.history.push(`/event/${event.designator}/edit`) }; render () { const { classes } = this.props return ( {({ loading, error, data }) => { if (loading) return 'Loading...' if (error) return `Error! ${error.message}` const list = data.hosts_EventsByHost.map((event, index) => { return ( ) }) return ( { list } ) }} { this.setState({ isNewEventOpen: false }) }} aria-labelledby='addEvent-dialog-title' > Host an event Here you will add just the minimal information, will be settable in the edit page of your event. ) } } export default withStyles(styles)(HostedEvent)