/
simple-template.jsx
59 lines (54 loc) · 1.18 KB
/
simple-template.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import * as React from 'react';
import Paper from '@material-ui/core/Paper';
import { ViewState } from '@devexpress/dx-react-scheduler';
import {
Scheduler,
WeekView,
Appointments,
} from '@devexpress/dx-react-scheduler-material-ui';
import { appointments } from '../../../demo-data/appointments';
const Appointment = ({
children, style, ...restProps
}) => (
<Appointments.Appointment
{...restProps}
style={{
...style,
backgroundColor: '#FFC107',
borderRadius: '8px',
}}
>
{children}
</Appointments.Appointment>
);
export default class Demo extends React.PureComponent {
constructor(props) {
super(props);
this.state = {
data: appointments,
currentDate: '2018-06-27',
};
}
render() {
const { data, currentDate } = this.state;
return (
<Paper>
<Scheduler
data={data}
height={660}
>
<ViewState
currentDate={currentDate}
/>
<WeekView
startDayHour={9}
endDayHour={19}
/>
<Appointments
appointmentComponent={Appointment}
/>
</Scheduler>
</Paper>
);
}
}