diff --git a/client/src/Components/Event/Create/Tabs/Basic.js b/client/src/Components/Event/Create/Tabs/Basic.js index 87760d33a..8c7797557 100644 --- a/client/src/Components/Event/Create/Tabs/Basic.js +++ b/client/src/Components/Event/Create/Tabs/Basic.js @@ -1,5 +1,23 @@ import React from 'react'; -import { Typography } from '@material-ui/core'; +import { + TextField, + FormControl, + InputLabel, + Input, + Button, + MenuItem, + FormGroup, + Select, + FormHelperText, + Typography, + Grid, +} 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'; @@ -7,18 +25,117 @@ import styles from '../styles'; class Basic extends React.Component { render() { - const { classes } = this.props; + const { classes, event, edit } = this.props; return ( - - Basic + + 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. + + + + edit('name', newVal.target.value)} + /> + edit('description', newVal.target.value)} + /> + + + 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={event.startDatetime} + helperText='Competition start date' + onChange={newVal => edit('startDatetime', newVal)} + /> + + + } + rightArrowIcon={} + value={event.finishDatetime} + helperText='Competition finishing date' + onChange={newVal => edit('finishDatetime', newVal)} + /> + + + + + + + Select the formula + + + For new formula, select {'"'}create new{'"'} + + + + Select the Plotter + + + For new plotter, select {'"'}create new{'"'} + + + + + + ); } diff --git a/client/src/Components/Event/Create/index.js b/client/src/Components/Event/Create/index.js index cfbd9686e..9def0ded7 100644 --- a/client/src/Components/Event/Create/index.js +++ b/client/src/Components/Event/Create/index.js @@ -3,31 +3,18 @@ import { Mutation } from 'react-apollo'; import { DateTime } from 'luxon'; import { - TextField, - FormControl, - InputLabel, - Input, - Button, - MenuItem, - FormGroup, - Select, - FormHelperText, Paper, - Grid, Typography, AppBar, Tabs, Tab, } from '@material-ui/core'; import { - ChevronLeft, - ChevronRight, Face as BasicIcon, Alarm as TechnicalIcon, Group as TeamAndServerIcon, PresentToAll as PresentationIcon, } from '@material-ui/icons'; -import { DateTimePicker } from 'material-ui-pickers'; import { withStyles } from '@material-ui/core/styles'; import styles from './styles'; @@ -60,13 +47,21 @@ class Create extends React.Component { }; } - handleChange = (event, value) => { + handleTabChange = (event, value) => { this.setState({ value }); } + handleEventChange = (newType, newVal) => { + this.setState({ [newType]: newVal }); + } + render() { const { - name, description, startDatetime, finishDatetime, value, + name, + description, + startDatetime, + finishDatetime, + value, } = this.state; const { classes } = this.props; return ( @@ -81,7 +76,7 @@ class Create extends React.Component { {value === 0 && - - 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{'"'} - - - - - - - - } + this.handleEventChange(newType, newVal)} + /> + } {value === 1 && } {value === 2 && } {value === 3 && }