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

Add support for customising the DayCell #483

Merged
merged 1 commit into from
Jun 10, 2021
Merged

Conversation

kamyar
Copy link
Contributor

@kamyar kamyar commented Jun 5, 2021

What types of changes does your code introduce?

  • New feature (non-breaking change which adds functionality)

Description

Adds support for passing a function to customize DayCell content.

Related Issue: #242

@kamyar kamyar mentioned this pull request Jun 5, 2021
3 tasks
@kamyar kamyar requested review from burakcan and mkg0 June 5, 2021 23:11
@brunolucena
Copy link

+1

Copy link
Collaborator

@mkg0 mkg0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM except for one thing

package-lock.json Outdated Show resolved Hide resolved
@kamyar kamyar force-pushed the custom-day-content-renderer branch from 034f65e to 48e7070 Compare June 10, 2021 12:11
Copy link
Collaborator

@onionhammer onionhammer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@kamyar kamyar merged commit bc440af into master Jun 10, 2021
@kamyar kamyar deleted the custom-day-content-renderer branch June 10, 2021 14:23
Copy link

@charithAmila charithAmila left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@HugoLiconV
Copy link

Hi everyone! Wouldn't be useful to implement something similar to this but for the whole button, not just for the content? So instead of doing this:

<button
// ...buttonProps
>
  {dayContentRenderer?.(this.props.day) || (
    <span>{format(this.props.day, this.props.dayDisplayFormat)}</span>
  )}
</button>

We'll be doing this:

if (dayContentRenderer) {
  return dayContentRenderer({  
    ...buttonProps
  });
}
return (
  <button
     // ...buttonProps
  >
    <span>{format(this.props.day, this.props.dayDisplayFormat)}</span>
  </button>
)

What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants