Skip to content

Commit

Permalink
Merge pull request #1942 from mrclickbits/DayColumnWrapper
Browse files Browse the repository at this point in the history
Introduce DayColumnWrapper component hook
  • Loading branch information
pietrofxq authored May 27, 2021
2 parents 2148e86 + 0065b5e commit cf090ef
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 13 deletions.
22 changes: 11 additions & 11 deletions .size-snapshot.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{
"./dist/react-big-calendar.js": {
"bundled": 509547,
"minified": 149932,
"gzipped": 45769
"bundled": 497580,
"minified": 153472,
"gzipped": 47831
},
"./dist/react-big-calendar.min.js": {
"bundled": 446246,
"minified": 130919,
"gzipped": 41339
"bundled": 428485,
"minified": 132196,
"gzipped": 42237
},
"dist/react-big-calendar.esm.js": {
"bundled": 176376,
"minified": 84316,
"gzipped": 21023,
"bundled": 185554,
"minified": 87500,
"gzipped": 21669,
"treeshaked": {
"rollup": {
"code": 60196,
"code": 62542,
"import_statements": 1590
},
"webpack": {
"code": 64714
"code": 67195
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/Calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,7 @@ class Calendar extends React.Component {
eventWrapper: PropTypes.elementType,
eventContainerWrapper: PropTypes.elementType,
dateCellWrapper: PropTypes.elementType,
dayColumnWrapper: PropTypes.elementType,
timeSlotWrapper: PropTypes.elementType,
timeGutterHeader: PropTypes.elementType,
resourceHeader: PropTypes.elementType,
Expand Down
11 changes: 9 additions & 2 deletions src/DayColumn.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import TimeSlotGroup from './TimeSlotGroup'
import TimeGridEvent from './TimeGridEvent'
import { DayLayoutAlgorithmPropType } from './utils/propTypes'

import DayColumnWrapper from './DayColumnWrapper'

class DayColumn extends React.Component {
state = { selecting: false, timeIndicatorPosition: null }
intervalTriggered = false
Expand Down Expand Up @@ -108,6 +110,7 @@ class DayColumn extends React.Component {

render() {
const {
date,
max,
rtl,
isNow,
Expand All @@ -125,8 +128,12 @@ class DayColumn extends React.Component {

const { className, style } = dayProp(max)

const DayColumnWrapperComponent =
components.dayColumnWrapper || DayColumnWrapper

return (
<div
<DayColumnWrapperComponent
date={date}
style={style}
className={clsx(
className,
Expand Down Expand Up @@ -174,7 +181,7 @@ class DayColumn extends React.Component {
style={{ top: `${this.state.timeIndicatorPosition}%` }}
/>
)}
</div>
</DayColumnWrapperComponent>
)
}

Expand Down
11 changes: 11 additions & 0 deletions src/DayColumnWrapper.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react'

const DayColumnWrapper = ({ children, className, style }) => {
return (
<div className={className} style={style}>
{children}
</div>
)
}

export default DayColumnWrapper

0 comments on commit cf090ef

Please sign in to comment.