-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
feat(components): showMore component customization #2537
base: master
Are you sure you want to change the base?
Conversation
action( | ||
`custom showMore component clicked with props: ${JSON.stringify( | ||
showMoreProps, | ||
null, | ||
2 | ||
)}` | ||
) | ||
}} |
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.
a681825
to
2eea37e
Compare
I'm trying to render a custom component for the `show more` button. I know there are a few recommended ways to do this through the `onShowMore` callback and the `messages.showMore` prop as suggested in jquense#1147. But that doesn't cover all use cases. For example, I want to access the events that are being hidden by the `show more` button. I also want to render a custom popup right next to the `show more` button. Resolves jquense#2391
2eea37e
to
770be8b
Compare
return count ? ( | ||
<ShowMore | ||
localizer={localizer} | ||
slotDate={slotMetrics.getDateForSlot(slot - 1)} |
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.
The getDateForSlot
access the slots range, and array, using the slot as the index. But the slot received in this method are not zero-based, which means, we need to adjust for the expected zero-based index used to pull from the range:
react-big-calendar/src/utils/DateSlotMetrics.js
Lines 38 to 40 in 12d81f0
getDateForSlot(slotNumber) { | |
return range[slotNumber] | |
}, |
I'm trying to render a custom component for the
show more
button. I know there are a few recommended ways to do this through theonShowMore
callback and themessages.showMore
prop as suggested in #1147.But that doesn't cover all use cases. For example, I want to access the events that are being hidden by the
show more
button. I also want to render a custom popup right next to theshow more
button.This new component adds the following props:
I can also update the types once this gets merged.
Resolves #2391
I tried reaching out through the Slack community first, but the invitation link has expired, could you post a new link?