2020-05-28 13:08:31 +00:00
|
|
|
import React, { useState } from 'react';
|
|
|
|
import {
|
|
|
|
Container,
|
|
|
|
Form,
|
|
|
|
FormControl,
|
|
|
|
FormGroup,
|
|
|
|
InputGroup,
|
|
|
|
Input,
|
|
|
|
Icon,
|
|
|
|
} from 'rsuite';
|
2020-05-27 13:51:41 +00:00
|
|
|
|
2020-05-27 18:49:49 +00:00
|
|
|
import TimezonePicker from '../components/General/TimezonePicker';
|
2020-05-28 13:42:36 +00:00
|
|
|
import DaySelector from '../components/Schedule/DaySelector';
|
2020-05-28 13:08:31 +00:00
|
|
|
import { durations } from '../assets/data/durations';
|
2020-05-27 13:51:41 +00:00
|
|
|
|
|
|
|
export default function Schedule() {
|
2020-05-28 13:08:31 +00:00
|
|
|
const [durationIdx, setDurationIdx] = useState(0);
|
|
|
|
|
|
|
|
const handleIncrement = () => {
|
2020-05-28 13:42:36 +00:00
|
|
|
if (durationIdx <= durations.length - 2) {
|
2020-05-28 13:08:31 +00:00
|
|
|
setDurationIdx(durationIdx + 1);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
const handleDecrement = () => {
|
|
|
|
if (durationIdx > 0) {
|
|
|
|
setDurationIdx(durationIdx - 1);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2020-05-27 13:51:41 +00:00
|
|
|
return (
|
|
|
|
<Container>
|
|
|
|
<h3>Schedule a meeting</h3>
|
2020-05-27 18:49:49 +00:00
|
|
|
<Form>
|
2020-05-27 13:51:41 +00:00
|
|
|
<FormGroup>
|
|
|
|
<FormControl name='title' type='text' placeholder='title' />
|
|
|
|
</FormGroup>
|
|
|
|
<FormGroup>
|
|
|
|
<Input
|
|
|
|
name='description'
|
|
|
|
componentClass='textarea'
|
|
|
|
type='text'
|
|
|
|
rows={3}
|
|
|
|
placeholder='Description'
|
|
|
|
/>
|
|
|
|
</FormGroup>
|
|
|
|
<FormGroup>
|
2020-05-27 18:49:49 +00:00
|
|
|
<TimezonePicker />
|
2020-05-27 13:51:41 +00:00
|
|
|
</FormGroup>
|
2020-05-28 13:08:31 +00:00
|
|
|
<FormGroup style={{ width: 200 }}>
|
2020-05-28 13:42:36 +00:00
|
|
|
<InputGroup style={{ background: 'white' }}>
|
2020-05-28 13:08:31 +00:00
|
|
|
<InputGroup.Button onClick={handleDecrement}>
|
|
|
|
<Icon icon='minus' />
|
|
|
|
</InputGroup.Button>
|
2020-05-28 13:42:36 +00:00
|
|
|
<div style={{ textAlign: 'center', paddingTop: 5 }}>
|
2020-05-28 13:08:31 +00:00
|
|
|
{durations[durationIdx].label}
|
|
|
|
</div>
|
|
|
|
<InputGroup.Button onClick={handleIncrement}>
|
|
|
|
<Icon icon='plus' />
|
|
|
|
</InputGroup.Button>
|
|
|
|
</InputGroup>
|
|
|
|
</FormGroup>
|
2020-05-28 13:42:36 +00:00
|
|
|
<DaySelector />
|
|
|
|
<FormGroup></FormGroup>
|
2020-05-27 13:51:41 +00:00
|
|
|
</Form>
|
|
|
|
</Container>
|
|
|
|
);
|
|
|
|
}
|