frontend/src/screens/Schedule.js

68 lines
1.5 KiB
JavaScript
Raw Normal View History

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 18:49:49 +00:00
import TimezonePicker from '../components/General/TimezonePicker';
import DaySelector from '../components/Schedule/DaySelector';
2020-05-28 13:08:31 +00:00
import { durations } from '../assets/data/durations';
export default function Schedule() {
2020-05-28 13:08:31 +00:00
const [durationIdx, setDurationIdx] = useState(0);
const handleIncrement = () => {
if (durationIdx <= durations.length - 2) {
2020-05-28 13:08:31 +00:00
setDurationIdx(durationIdx + 1);
}
};
const handleDecrement = () => {
if (durationIdx > 0) {
setDurationIdx(durationIdx - 1);
}
};
return (
<Container>
<h3>Schedule a meeting</h3>
2020-05-27 18:49:49 +00:00
<Form>
<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 />
</FormGroup>
2020-05-28 13:08:31 +00:00
<FormGroup style={{ width: 200 }}>
<InputGroup style={{ background: 'white' }}>
2020-05-28 13:08:31 +00:00
<InputGroup.Button onClick={handleDecrement}>
<Icon icon='minus' />
</InputGroup.Button>
<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>
<DaySelector />
<FormGroup></FormGroup>
</Form>
</Container>
);
}