From 0065b5e812ad6f7f8dfce3731c53301477c1c8ee Mon Sep 17 00:00:00 2001 From: Maximilian Richter Date: Fri, 21 May 2021 08:58:32 +0200 Subject: [PATCH] Introduce DayColumnWrapper hook --- .size-snapshot.json | 22 +++++++++++----------- src/Calendar.js | 1 + src/DayColumn.js | 11 +++++++++-- src/DayColumnWrapper.js | 11 +++++++++++ 4 files changed, 32 insertions(+), 13 deletions(-) create mode 100644 src/DayColumnWrapper.js diff --git a/.size-snapshot.json b/.size-snapshot.json index b6e1a03e1..15855dc43 100644 --- a/.size-snapshot.json +++ b/.size-snapshot.json @@ -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 } } } diff --git a/src/Calendar.js b/src/Calendar.js index 94f703426..d304fa89c 100644 --- a/src/Calendar.js +++ b/src/Calendar.js @@ -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, diff --git a/src/DayColumn.js b/src/DayColumn.js index 550cbf515..25d3ec20e 100644 --- a/src/DayColumn.js +++ b/src/DayColumn.js @@ -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 @@ -108,6 +110,7 @@ class DayColumn extends React.Component { render() { const { + date, max, rtl, isNow, @@ -125,8 +128,12 @@ class DayColumn extends React.Component { const { className, style } = dayProp(max) + const DayColumnWrapperComponent = + components.dayColumnWrapper || DayColumnWrapper + return ( -
)} -
+ ) } diff --git a/src/DayColumnWrapper.js b/src/DayColumnWrapper.js new file mode 100644 index 000000000..2d8ca9f18 --- /dev/null +++ b/src/DayColumnWrapper.js @@ -0,0 +1,11 @@ +import React from 'react' + +const DayColumnWrapper = ({ children, className, style }) => { + return ( +
+ {children} +
+ ) +} + +export default DayColumnWrapper