@@ -505,7 +532,7 @@ storiesOf('module.Calendar.week', module)
return (
+
+ )
+ })
+ .add('draggable and resizable with custom dateCellWrapper', () => {
+ return (
+
+
+
+ )
+ })
+ .add('draggable and resizable with custom dayWrapper', () => {
+ return (
+
+
{
+ // Show 'click me' text in arbitrary places by using the range prop
+ const hasAlert = dateCellWrapperProps.range
+ ? dateCellWrapperProps.range.some(date => {
+ return date.getDate() % 12 === 0
+ })
+ : false
+
+ const style = {
+ display: 'flex',
+ flex: 1,
+ borderLeft: '1px solid #DDD',
+ backgroundColor: hasAlert ? '#f5f5dc' : '#fff',
+ }
+ return (
+
+ {hasAlert && (
+
+ Click me
+
+ )}
+ {dateCellWrapperProps.children}
+
+ )
+ },
+ dayWrapper: dayWrapperProps => {
+ // Show different styles at arbitrary time
+ const hasCustomInfo = dayWrapperProps.value
+ ? dayWrapperProps.value.getHours() === 4
+ : false
+ const style = {
+ display: 'flex',
+ flex: 1,
+ backgroundColor: hasCustomInfo ? '#f5f5dc' : '#fff',
+ }
+ return (
+
+ {hasCustomInfo && 'Custom Day Wrapper'}
+ {dayWrapperProps.children}
+
+ )
+ },
+}
+
+export default customComponents