Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: pass dates to slotGroupPropGetter #2066

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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