Add a basic FullCalendar to Schedule screen
This commit is contained in:
13
src/components/Schedule/DaySelector.js
Normal file
13
src/components/Schedule/DaySelector.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import React from 'react';
|
||||
import FullCalendar from '@fullcalendar/react';
|
||||
import dayGridPlugin from '@fullcalendar/daygrid';
|
||||
|
||||
export default function DaySelector() {
|
||||
|
||||
return (
|
||||
<FullCalendar
|
||||
initialView='dayGridMonth'
|
||||
plugins={[dayGridPlugin]}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -10,17 +10,17 @@ import {
|
||||
} from 'rsuite';
|
||||
|
||||
import TimezonePicker from '../components/General/TimezonePicker';
|
||||
import DaySelector from '../components/Schedule/DaySelector';
|
||||
import { durations } from '../assets/data/durations';
|
||||
|
||||
export default function Schedule() {
|
||||
const [durationIdx, setDurationIdx] = useState(0);
|
||||
|
||||
const handleIncrement = () => {
|
||||
if (durationIdx <= durations.length-2) {
|
||||
if (durationIdx <= durations.length - 2) {
|
||||
setDurationIdx(durationIdx + 1);
|
||||
}
|
||||
};
|
||||
|
||||
const handleDecrement = () => {
|
||||
if (durationIdx > 0) {
|
||||
setDurationIdx(durationIdx - 1);
|
||||
@@ -47,11 +47,11 @@ export default function Schedule() {
|
||||
<TimezonePicker />
|
||||
</FormGroup>
|
||||
<FormGroup style={{ width: 200 }}>
|
||||
<InputGroup style={{background: 'white'}}>
|
||||
<InputGroup style={{ background: 'white' }}>
|
||||
<InputGroup.Button onClick={handleDecrement}>
|
||||
<Icon icon='minus' />
|
||||
</InputGroup.Button>
|
||||
<div style={{ textAlign: 'center', paddingTop:5 }}>
|
||||
<div style={{ textAlign: 'center', paddingTop: 5 }}>
|
||||
{durations[durationIdx].label}
|
||||
</div>
|
||||
<InputGroup.Button onClick={handleIncrement}>
|
||||
@@ -59,6 +59,8 @@ export default function Schedule() {
|
||||
</InputGroup.Button>
|
||||
</InputGroup>
|
||||
</FormGroup>
|
||||
<DaySelector />
|
||||
<FormGroup></FormGroup>
|
||||
</Form>
|
||||
</Container>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user