Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
cutterbl committed Sep 25, 2020
2 parents 90a5afb + ca8d77b commit 41b3333
Show file tree
Hide file tree
Showing 24 changed files with 307 additions and 198 deletions.
4 changes: 4 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ parser: babel-eslint
extends:
- jason/react
- prettier
plugins:
- react-hooks
env:
es6: true
rules:
Expand All @@ -15,3 +17,5 @@ rules:
varsIgnorePattern: ^_,
argsIgnorePattern: ^_,
}]
react-hooks/rules-of-hooks: error
react-hooks/exhaustive-deps: warn
24 changes: 12 additions & 12 deletions .size-snapshot.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{
"./dist/react-big-calendar.js": {
"bundled": 507436,
"minified": 149016,
"gzipped": 45496
"bundled": 509547,
"minified": 149932,
"gzipped": 45769
},
"./dist/react-big-calendar.min.js": {
"bundled": 444328,
"minified": 130089,
"gzipped": 41174
"bundled": 446246,
"minified": 130919,
"gzipped": 41339
},
"dist/react-big-calendar.esm.js": {
"bundled": 174497,
"minified": 83179,
"gzipped": 20739,
"bundled": 176376,
"minified": 84316,
"gzipped": 21023,
"treeshaked": {
"rollup": {
"code": 60400,
"import_statements": 1578
"code": 60196,
"import_statements": 1590
},
"webpack": {
"code": 64923
"code": 64714
}
}
}
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,9 @@ const MyCalendar = props => (

## Custom Styling

Out of the box you can include the compiled css files and be up and running. But, sometimes, you may want to style
Big Calendar to match your application styling. For this reason SASS files are included with Big Calendar.
Out of the box, you can include the compiled CSS files and be up and running. But, sometimes, you may want to style
Big Calendar to match your application styling. For this reason, SASS files are included with Big Calendar.


```
@import 'react-big-calendar/lib/sass/styles';
Expand All @@ -126,4 +127,4 @@ Big Calendar. Carefully test each change accordingly.

## Join us on Reactiflux Discord

Join us on [Reactiflux Discord](https://discord.gg/uJsgpkC) community under the channel #react-big-calendar if you have any questions.
Join us on [Reactiflux Discord](https://discord.gg/PPgj6tb) community under the channel #libraries if you have any questions.
42 changes: 36 additions & 6 deletions examples/demos/dnd.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,39 @@ class Dnd extends React.Component {
super(props)
this.state = {
events: events,
displayDragItemInCell: true,
}

this.moveEvent = this.moveEvent.bind(this)
this.newEvent = this.newEvent.bind(this)
}

moveEvent({ event, start, end, isAllDay: droppedOnAllDaySlot }) {
handleDragStart = event => {
this.setState({ draggedEvent: event })
}

dragFromOutsideItem = () => {
return this.state.draggedEvent
}

onDropFromOutside = ({ start, end, allDay }) => {
const { draggedEvent } = this.state

const event = {
id: draggedEvent.id,
title: draggedEvent.title,
start,
end,
allDay: allDay,
}

this.setState({ draggedEvent: null })
this.moveEvent({ event, start, end })
}

moveEvent = ({ event, start, end, isAllDay: droppedOnAllDaySlot }) => {
const { events } = this.state

const idx = events.indexOf(event)
let allDay = event.allDay

if (!event.allDay && droppedOnAllDaySlot) {
Expand All @@ -30,10 +53,11 @@ class Dnd extends React.Component {
allDay = false
}

const updatedEvent = { ...event, start, end, allDay }

const nextEvents = [...events]
nextEvents.splice(idx, 1, updatedEvent)
const nextEvents = events.map(existingEvent => {
return existingEvent.id == event.id
? { ...existingEvent, start, end }
: existingEvent
})

this.setState({
events: nextEvents,
Expand Down Expand Up @@ -86,6 +110,12 @@ class Dnd extends React.Component {
onDragStart={console.log}
defaultView={Views.MONTH}
defaultDate={new Date(2015, 3, 12)}
popup={true}
dragFromOutsideItem={
this.state.displayDragItemInCell ? this.dragFromOutsideItem : null
}
onDropFromOutside={this.onDropFromOutside}
handleDragStart={this.handleDragStart}
/>
)
}
Expand Down
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/intljusticemission/react-big-calendar.git"
"url": "git+https://github.com/jquense/react-big-calendar.git"
},
"license": "MIT",
"main": "lib/index.js",
Expand Down Expand Up @@ -95,6 +95,7 @@
"eslint-import-resolver-webpack": "^0.10.1",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-react": "^7.11.1",
"eslint-plugin-react-hooks": "^4.0.4",
"font-awesome": "^4.7.0",
"globalize": "^0.1.1",
"husky": "^0.14.3",
Expand All @@ -108,10 +109,10 @@
"postcss": "^7.0.16",
"postcss-cli": "^6.1.2",
"prettier": "^1.15.1",
"react": "^16.6.1",
"react": "^16.13.1",
"react-bootstrap": "^0.32.4",
"react-docgen": "^3.0.0-rc.1",
"react-dom": "^16.6.1",
"react-dom": "^16.13.1",
"react-tackle-box": "^2.1.0",
"rimraf": "^2.4.2",
"rollup": "^1.1.0",
Expand All @@ -134,18 +135,18 @@
"invariant": "^2.2.4",
"lodash": "^4.17.11",
"lodash-es": "^4.17.11",
"memoize-one": "^4.0.3",
"prop-types": "^15.6.2",
"memoize-one": "^5.1.1",
"prop-types": "^15.7.2",
"react-overlays": "^2.0.0-0",
"uncontrollable": "^7.0.0"
},
"resolutions": {
"babel-core": "7.0.0-bridge.0"
},
"bugs": {
"url": "https://github.com/intljusticemission/react-big-calendar/issues"
"url": "https://github.com/jquense/react-big-calendar/issues"
},
"readme": "ERROR: No README data found!",
"homepage": "https://github.com/intljusticemission/react-big-calendar#readme",
"homepage": "https://github.com/jquense/react-big-calendar#readme",
"_id": "[email protected]"
}
Loading

0 comments on commit 41b3333

Please sign in to comment.