-
-
Notifications
You must be signed in to change notification settings - Fork 739
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
Add a overlayWrapper prop to DayPicker for greater customization. #486
Conversation
Codecov Report
@@ Coverage Diff @@
## master #486 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 15 15
Lines 531 534 +3
Branches 109 109
=====================================
+ Hits 531 534 +3
Continue to review full report at Codecov.
|
32a7b59
to
5632df7
Compare
src/DayPicker.js
Outdated
{this.renderNavbar()} | ||
{this.renderMonths()} | ||
</div>, | ||
containerProps.children ? containerProps.children : null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 what if the calendar should be placed after the containerProps.children
?
Hi, thanks for this PR 🙏 I was thinking to add a new prop to Indeed, wrapping <MyWrapper>
<DayPicker />
</MyWrapper> What we need is a different wrapper for the overlay, here where we are rendering the DayPicker in react-day-picker/src/DayPickerInput.js Lines 267 to 277 in efd1d6f
For example, I was thinking the prop to be a function and working this way: <DayPickerInput
wrapperComponent={ ({children, ...props)} =>
<div {...props}>
<p>This is placed before the calendar</p>
<div>{ children }</div> /* this will render the calendar */
<p>This is placed after the calendar</p>
</div>
}
/> What do you think? PS. Maybe it's better call the prop |
5632df7
to
a670fea
Compare
…elements around the `DayPicker`
a670fea
to
8f98e98
Compare
Updated the PR, the prop is now called |
Hey, thanks for this – I've fixed some parts in #563. Sorry for the delay... |
Thanks @wldcordeiro for your help! I’ve published the new prop in the v7. |
This PR tries to address #477 by adding a
overlayWrapper
prop that allows you to customize the component wrapping theDayPicker
withinDayPickerInput