Skip to content

Commit 9e9f34b

Browse files
improve folder structure
1 parent 50a28f4 commit 9e9f34b

File tree

3 files changed

+689
-23
lines changed

3 files changed

+689
-23
lines changed

example/src/App.js

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,42 @@
1-
import React, { Component } from 'react'
1+
import React, { Component } from "react";
22

3-
import ExampleComponent from 'react-range-calendar'
3+
import Calendar from "react-range-calendar";
44

55
export default class App extends Component {
6-
render () {
6+
state = {
7+
visible: true,
8+
startWithDates: [new Date(), new Date("21/5/2019")]
9+
};
10+
render() {
11+
const { visible, startWithDates } = this.state;
12+
const step = 7;
13+
const startWith = "Wed";
714
return (
8-
<div>
9-
<ExampleComponent text='Modern React component module' />
15+
<div className="App">
16+
<button onClick={() => this.setState({ visible: !visible })}>
17+
Toggle Calendar
18+
</button>
19+
<div style={{ display: "flex", justifyContent: "center" }}>
20+
<Calendar
21+
visible={visible}
22+
// date={date}
23+
step={step}
24+
startWith={startWith}
25+
startWithDates={startWithDates}
26+
onDayClick={(minDate, maxDate) => {
27+
this.setState({ startWithDates: [minDate, maxDate] });
28+
}}
29+
// baseColor="red"
30+
// fontColor="yellow"
31+
// hoverBackgroundColor="brown"
32+
// hoverFontColor="black"
33+
// disabledColor="orange"
34+
// weekDaysColor="green"
35+
// weekendsDaysColor="black"
36+
type="fix-range"
37+
/>
38+
</div>
1039
</div>
11-
)
40+
);
1241
}
1342
}

0 commit comments

Comments
 (0)