Skip to content

Commit f596053

Browse files
authored
Fixup resource PR (jquense#671)
* fixup resource PR * format
1 parent 1937404 commit f596053

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1278
-798
lines changed

.storybook/config.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { configure } from '@storybook/react';
1+
import { configure } from '@storybook/react'
22

33
function loadStories() {
4-
require('../stories');
4+
require('../stories')
55
}
66

7-
configure(loadStories, module);
7+
configure(loadStories, module)

.storybook/webpack.config.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
const { rules, loaders, plugins, stats } = require("webpack-atoms");
1+
const { rules, loaders, plugins, stats } = require('webpack-atoms')
22

3-
const browsers = ["last 2 versions", "ie >= 10"];
3+
const browsers = ['last 2 versions', 'ie >= 10']
44

55
module.exports = function(config) {
66
return {
@@ -11,9 +11,9 @@ module.exports = function(config) {
1111
rules.fonts(),
1212
rules.images(),
1313
rules.css(),
14-
rules.less({ browsers })
15-
]
14+
rules.less({ browsers }),
15+
],
1616
},
17-
plugins: [...config.plugins, plugins.extractText()]
18-
};
19-
};
17+
plugins: [...config.plugins, plugins.extractText()],
18+
}
19+
}

examples/Api.js

+17-4
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ let Api = React.createClass({
5353
<div style={{ paddingLeft: 0 }}>
5454
<div>
5555
{'type: '}
56-
{typeInfo && typeInfo.type === 'pre' ? typeInfo : <code>{typeInfo}</code>}
56+
{typeInfo && typeInfo.type === 'pre' ? (
57+
typeInfo
58+
) : (
59+
<code>{typeInfo}</code>
60+
)}
5761
</div>
5862
{data.defaultValue && (
5963
<div>
@@ -64,7 +68,11 @@ let Api = React.createClass({
6468
) : (
6569
<div>
6670
{Object.keys(data.type.value).map(propName =>
67-
this.renderProp(data.type.value[propName], name + '.' + propName, 'h4')
71+
this.renderProp(
72+
data.type.value[propName],
73+
name + '.' + propName,
74+
'h4'
75+
)
6876
)}
6977
</div>
7078
)}
@@ -91,7 +99,11 @@ let Api = React.createClass({
9199
case 'object':
92100
case 'Object':
93101
if (type.value)
94-
return <pre className="shape-prop">{displayObj(renderObject(type.value))}</pre>
102+
return (
103+
<pre className="shape-prop">
104+
{displayObj(renderObject(type.value))}
105+
</pre>
106+
)
95107

96108
return name
97109
case 'union':
@@ -133,7 +145,8 @@ let Api = React.createClass({
133145

134146
renderControllableNote(prop, propName) {
135147
let controllable = prop.doclets && prop.doclets.controllable
136-
let isHandler = prop.type && getDisplayTypeName(prop.type.name) === 'function'
148+
let isHandler =
149+
prop.type && getDisplayTypeName(prop.type.name) === 'function'
137150

138151
if (!controllable) {
139152
return false

examples/App.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ import CustomView from './demos/customView'
2121
import Timeslots from './demos/timeslots'
2222
import Dnd from './demos/dnd'
2323

24-
let demoRoot = 'https://github.com/intljusticemission/react-big-calendar/tree/master/examples/demos'
24+
let demoRoot =
25+
'https://github.com/intljusticemission/react-big-calendar/tree/master/examples/demos'
2526

2627
const Example = React.createClass({
2728
getInitialState() {
@@ -60,7 +61,10 @@ const Example = React.createClass({
6061
<i className="fa fa-book" /> API documentation
6162
</a>
6263
{' | '}
63-
<a target="_blank" href="https://github.com/intljusticemission/react-big-calendar">
64+
<a
65+
target="_blank"
66+
href="https://github.com/intljusticemission/react-big-calendar"
67+
>
6468
<i className="fa fa-github" /> github
6569
</a>
6670
</p>

examples/demos/basic.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import React from 'react';
2-
import BigCalendar from 'react-big-calendar';
3-
import events from '../events';
1+
import React from 'react'
2+
import BigCalendar from 'react-big-calendar'
3+
import events from '../events'
44

55
let allViews = Object.keys(BigCalendar.Views).map(k => BigCalendar.Views[k])
66

77
let Basic = React.createClass({
8-
render(){
8+
render() {
99
return (
1010
<BigCalendar
1111
{...this.props}
@@ -15,7 +15,7 @@ let Basic = React.createClass({
1515
defaultDate={new Date(2015, 3, 1)}
1616
/>
1717
)
18-
}
18+
},
1919
})
2020

21-
export default Basic;
21+
export default Basic

examples/demos/cultures.js

+20-22
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,36 @@
1-
import React from 'react';
2-
import BigCalendar from 'react-big-calendar';
3-
import events from '../events';
1+
import React from 'react'
2+
import BigCalendar from 'react-big-calendar'
3+
import events from '../events'
44

5-
require('globalize/lib/cultures/globalize.culture.en-GB');
6-
require('globalize/lib/cultures/globalize.culture.es');
7-
require('globalize/lib/cultures/globalize.culture.fr');
8-
require('globalize/lib/cultures/globalize.culture.ar-AE');
5+
require('globalize/lib/cultures/globalize.culture.en-GB')
6+
require('globalize/lib/cultures/globalize.culture.es')
7+
require('globalize/lib/cultures/globalize.culture.fr')
8+
require('globalize/lib/cultures/globalize.culture.ar-AE')
99

1010
let Cultures = React.createClass({
11-
12-
getInitialState(){
11+
getInitialState() {
1312
return { culture: 'fr' }
1413
},
1514

16-
render(){
15+
render() {
1716
let cultures = ['en', 'en-GB', 'es', 'fr', 'ar-AE']
18-
let rtl = this.state.culture === 'ar-AE';
17+
let rtl = this.state.culture === 'ar-AE'
1918

2019
return (
2120
<div {...this.props}>
2221
<h3 className="callout">
23-
<label>Select a Culture</label>
24-
{' '}
22+
<label>Select a Culture</label>{' '}
2523
<select
26-
className='form-control'
27-
style={{ width: 200, display: 'inline-block'}}
24+
className="form-control"
25+
style={{ width: 200, display: 'inline-block' }}
2826
defaultValue={'fr'}
2927
onChange={e => this.setState({ culture: e.target.value })}
3028
>
31-
{
32-
cultures.map((c, idx) =>
33-
<option key={idx} value={c}>{c}</option>
34-
)
35-
}
29+
{cultures.map((c, idx) => (
30+
<option key={idx} value={c}>
31+
{c}
32+
</option>
33+
))}
3634
</select>
3735
</h3>
3836
<BigCalendar
@@ -43,7 +41,7 @@ let Cultures = React.createClass({
4341
/>
4442
</div>
4543
)
46-
}
44+
},
4745
})
4846

49-
export default Cultures;
47+
export default Cultures

examples/demos/customHeader.js

+14-16
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,41 @@
1-
import React from 'react';
2-
import BigCalendar from 'react-big-calendar';
3-
import events from '../events';
4-
1+
import React from 'react'
2+
import BigCalendar from 'react-big-calendar'
3+
import events from '../events'
54

65
let MyOtherNestedComponent = React.createClass({
7-
render(){
6+
render() {
87
return <div>NESTED COMPONENT</div>
9-
}
8+
},
109
})
1110

1211
let MyCustomHeader = React.createClass({
13-
render(){
12+
render() {
1413
const { label } = this.props
1514
return (
1615
<div>
1716
CUSTOM HEADER:
18-
<div>{ label }</div>
17+
<div>{label}</div>
1918
<MyOtherNestedComponent />
2019
</div>
2120
)
22-
}
21+
},
2322
})
2423

25-
2624
let CustomHeader = React.createClass({
27-
render(){
25+
render() {
2826
return (
2927
<BigCalendar
3028
{...this.props}
3129
events={events}
3230
defaultDate={new Date(2015, 3, 1)}
3331
components={{
34-
day: {header: MyCustomHeader},
35-
week: {header: MyCustomHeader},
36-
month: {header: MyCustomHeader}
32+
day: { header: MyCustomHeader },
33+
week: { header: MyCustomHeader },
34+
month: { header: MyCustomHeader },
3735
}}
3836
/>
3937
)
40-
}
38+
},
4139
})
4240

43-
export default CustomHeader;
41+
export default CustomHeader

examples/demos/customView.js

+21-25
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,54 @@
1-
import React from 'react';
2-
3-
import dates from 'date-arithmetic';
4-
import events from '../events';
5-
import BigCalendar from 'react-big-calendar';
6-
import localizer from 'react-big-calendar/lib/localizer';
7-
import TimeGrid from 'react-big-calendar/lib/TimeGrid';
1+
import React from 'react'
82

3+
import dates from 'date-arithmetic'
4+
import events from '../events'
5+
import BigCalendar from 'react-big-calendar'
6+
import localizer from 'react-big-calendar/lib/localizer'
7+
import TimeGrid from 'react-big-calendar/lib/TimeGrid'
98

109
const getRange = (date, culture) => {
11-
let firstOfWeek = localizer.startOfWeek(culture);
12-
let start = dates.startOf(date, 'week', firstOfWeek);
13-
let end = dates.endOf(date, 'week', firstOfWeek);
10+
let firstOfWeek = localizer.startOfWeek(culture)
11+
let start = dates.startOf(date, 'week', firstOfWeek)
12+
let end = dates.endOf(date, 'week', firstOfWeek)
1413

1514
if (firstOfWeek === 1) {
16-
end = dates.subtract(end, 2, 'day');
15+
end = dates.subtract(end, 2, 'day')
1716
} else {
18-
start = dates.add(start, 1, 'day');
19-
end = dates.subtract(end, 1, 'day');
17+
start = dates.add(start, 1, 'day')
18+
end = dates.subtract(end, 1, 'day')
2019
}
2120

2221
return dates.range(start, end)
2322
}
2423

2524
class MyWeek extends React.Component {
2625
render() {
27-
let { date, culture } = this.props;
28-
let range = getRange(date, culture);
26+
let { date, culture } = this.props
27+
let range = getRange(date, culture)
2928

30-
return (
31-
<TimeGrid {...this.props} range={range} eventOffset={15} />
32-
);
29+
return <TimeGrid {...this.props} range={range} eventOffset={15} />
3330
}
3431
}
3532

3633
MyWeek.navigate = (date, action) => {
37-
switch (action){
34+
switch (action) {
3835
case BigCalendar.Navigate.PREVIOUS:
39-
return dates.add(date, -1, 'week');
36+
return dates.add(date, -1, 'week')
4037

4138
case BigCalendar.Navigate.NEXT:
4239
return dates.add(date, 1, 'week')
4340

4441
default:
45-
return date;
42+
return date
4643
}
4744
}
4845

4946
MyWeek.title = (date, { formats, culture }) => {
5047
return `My awesome week: ${Date.toLocaleString()}`
5148
}
5249

53-
5450
let CustomView = React.createClass({
55-
render(){
51+
render() {
5652
return (
5753
<div>
5854
<BigCalendar
@@ -63,7 +59,7 @@ let CustomView = React.createClass({
6359
/>
6460
</div>
6561
)
66-
}
62+
},
6763
})
6864

69-
export default CustomView;
65+
export default CustomView

0 commit comments

Comments
 (0)