Event/task edit: improve design.

master
Tom Hacohen 5 years ago
parent fed79fcfea
commit 6a0fc11ab3

@ -9,6 +9,7 @@ import TextField from '@material-ui/core/TextField';
import Select from '@material-ui/core/Select'; import Select from '@material-ui/core/Select';
import MenuItem from '@material-ui/core/MenuItem'; import MenuItem from '@material-ui/core/MenuItem';
import FormControl from '@material-ui/core/FormControl'; import FormControl from '@material-ui/core/FormControl';
import FormHelperText from '@material-ui/core/FormHelperText';
import InputLabel from '@material-ui/core/InputLabel'; import InputLabel from '@material-ui/core/InputLabel';
import * as colors from '@material-ui/core/colors'; import * as colors from '@material-ui/core/colors';
@ -258,37 +259,39 @@ class EventEdit extends React.PureComponent<PropsType> {
</Select> </Select>
</FormControl> </FormControl>
<FormGroup> <FormControl>
<FormControlLabel <FormHelperText>FROM</FormHelperText>
control={
<Switch
name="allDay"
checked={this.state.allDay}
onChange={this.toggleAllDay}
color="primary"
/>
}
label="All Day"
/>
</FormGroup>
<div>
<DateTimePicker <DateTimePicker
dateOnly={this.state.allDay} dateOnly={this.state.allDay}
placeholder="Start" placeholder="Start"
value={this.state.start} value={this.state.start}
onChange={(date?: Date) => this.setState({ start: date })} onChange={(date?: Date) => this.setState({ start: date })}
/> />
</div> </FormControl>
<div> <FormControl>
<FormHelperText>TO</FormHelperText>
<DateTimePicker <DateTimePicker
dateOnly={this.state.allDay} dateOnly={this.state.allDay}
placeholder="End" placeholder="End"
value={this.state.end} value={this.state.end}
onChange={(date?: Date) => this.setState({ end: date })} onChange={(date?: Date) => this.setState({ end: date })}
/> />
</div> </FormControl>
<FormGroup>
<FormControlLabel
control={
<Switch
name="allDay"
checked={this.state.allDay}
onChange={this.toggleAllDay}
color="primary"
/>
}
label="All Day"
/>
</FormGroup>
<TextField <TextField
name="location" name="location"

@ -9,6 +9,7 @@ import TextField from '@material-ui/core/TextField';
import Select from '@material-ui/core/Select'; import Select from '@material-ui/core/Select';
import MenuItem from '@material-ui/core/MenuItem'; import MenuItem from '@material-ui/core/MenuItem';
import FormControl from '@material-ui/core/FormControl'; import FormControl from '@material-ui/core/FormControl';
import FormHelperText from '@material-ui/core/FormHelperText';
import InputLabel from '@material-ui/core/InputLabel'; import InputLabel from '@material-ui/core/InputLabel';
import * as colors from '@material-ui/core/colors'; import * as colors from '@material-ui/core/colors';
@ -262,6 +263,26 @@ class TaskEdit extends React.PureComponent<PropsType> {
</Select> </Select>
</FormControl> </FormControl>
<FormControl>
<FormHelperText>Start</FormHelperText>
<DateTimePicker
dateOnly={this.state.allDay}
placeholder="Start"
value={this.state.start}
onChange={(date?: Date) => this.setState({ start: date })}
/>
</FormControl>
<FormControl>
<FormHelperText>Due</FormHelperText>
<DateTimePicker
dateOnly={this.state.allDay}
placeholder="Due"
value={this.state.due}
onChange={(date?: Date) => this.setState({ due: date })}
/>
</FormControl>
<FormGroup> <FormGroup>
<FormControlLabel <FormControlLabel
control={ control={
@ -276,24 +297,6 @@ class TaskEdit extends React.PureComponent<PropsType> {
/> />
</FormGroup> </FormGroup>
<div>
<DateTimePicker
dateOnly={this.state.allDay}
placeholder="Start"
value={this.state.start}
onChange={(date?: Date) => this.setState({ start: date })}
/>
</div>
<div>
<DateTimePicker
dateOnly={this.state.allDay}
placeholder="End"
value={this.state.due}
onChange={(date?: Date) => this.setState({ due: date })}
/>
</div>
<TextField <TextField
name="location" name="location"
placeholder="Add location" placeholder="Add location"

Loading…
Cancel
Save