Skip to content
This repository has been archived by the owner on Jul 8, 2024. It is now read-only.

Commit

Permalink
fix: pass dates to slotGroupPropGetter (jquense#2066)
Browse files Browse the repository at this point in the history
Fixes an issue where you could not properly style slot groups
  • Loading branch information
skv-headless authored Feb 15, 2023
1 parent 3115e12 commit 943ae6e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ class Calendar extends React.Component {
* Optionally provide a function that returns an object of props to be applied
* to the time-slot group node. Useful to dynamically change the sizing of time nodes.
* ```js
* () => { style?: Object }
* (group: Date[]) => { style?: Object }
* ```
*/
slotGroupPropGetter: PropTypes.func,
Expand Down
2 changes: 1 addition & 1 deletion src/TimeSlotGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default class TimeSlotGroup extends Component {
components: { timeSlotWrapper: Wrapper = BackgroundWrapper } = {},
} = this.props

const groupProps = getters ? getters.slotGroupProp() : {}
const groupProps = getters ? getters.slotGroupProp(group) : {}
return (
<div className="rbc-timeslot-group" {...groupProps}>
{group.map((value, idx) => {
Expand Down
2 changes: 1 addition & 1 deletion stories/props/API.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ Optionally provide a function that returns an object of className or style props
### slotGroupPropGetter
- type: `function () => { style?: Object }`
- type: `function (group: Date[]) => { style?: Object }`
- <LinkTo kind="props" story="slot-group-prop-getter">
Example
</LinkTo>
Expand Down
2 changes: 1 addition & 1 deletion stories/props/slotGroupPropGetter.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import LinkTo from '@storybook/addon-links/react'

# slotGroupPropGetter

- type: `function () => { style?: Object }`
- type: `function (group: Date[]) => { style?: Object }`

Optionally provide a function that returns an object of className or style props to be applied to the time-slot node.

Expand Down

0 comments on commit 943ae6e

Please sign in to comment.