close
Skip to content
This repository was archived by the owner on May 19, 2025. It is now read-only.

Add support for customising the DayCell#483

Merged
kamyar merged 1 commit intomasterfrom
custom-day-content-renderer
Jun 10, 2021
Merged

Add support for customising the DayCell#483
kamyar merged 1 commit intomasterfrom
custom-day-content-renderer

Conversation

@kamyar
Copy link
Copy Markdown
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
Copy Markdown

+1

Copy link
Copy Markdown
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

Comment thread package-lock.json Outdated
@kamyar kamyar force-pushed the custom-day-content-renderer branch from 034f65e to 48e7070 Compare June 10, 2021 12:11
Copy link
Copy Markdown
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
Copy Markdown

@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
Copy Markdown

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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants