import React from 'react'; import { Mutation } from 'react-apollo'; import { DateTime } from 'luxon'; import { TextField, FormControl, InputLabel, Input, Button, MenuItem, FormGroup, Select, FormHelperText, Paper, Grid, Typography, } from '@material-ui/core'; import { ChevronLeft, ChevronRight } from '@material-ui/icons'; import { DateTimePicker } from 'material-ui-pickers'; import { withStyles } from '@material-ui/core/styles'; import styles from './styles'; import { hostedEventsCalls } from '../../../GraphQL/Calls'; class Create extends React.Component { constructor(props) { super(props); this.state = { name: '', description: '', startDatetime: DateTime.local().plus({ days: 1 }).startOf('day'), finishDatetime: DateTime.local().plus({ days: 8 }).startOf('day'), }; } render() { const { name, description, startDatetime, finishDatetime, } = this.state; const { classes } = this.props; return ( { this.props.history.push(`/edit/${data.events_CreateEvent.id}`); } } > {hostEvent => ( Create a new event
{ e.preventDefault(); hostEvent({ variables: { event: { name, description, startDatetime: startDatetime.valueOf() / 1000, finishDatetime: startDatetime.valueOf() / 1000, }, }, }); }} > These are the basic information you need to input in order to create an event. There might be some heavy changes in the near future as the application is still at a very early stage. The dates are purely indicative, as it is important for you to make sure everything is ready before manually triggering the beginning and end of the event. If you are confident use the scheduler to start it for you(incoming). } rightArrowIcon={} value={startDatetime} helperText='Competition start date' /> } rightArrowIcon={} value={finishDatetime} helperText='Competition finishing date' /> Select the formula For new formula, select {'"'}create new{'"'} Select the Plotter For new plotter, select {'"'}create new{'"'}
)}
); } } export default withStyles(styles)(Create);