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

feat(calendar): upgrade react-day-picker to v9.6.1 and customize component #6905

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

LeonardoSeptaVN
Copy link

feat(calendar): upgrade react-day-picker to v9.6.1 and customize component

  • Upgraded react-day-picker from v8.7.1 to v9.6.1 for improved performance and compatibility
  • Refactored and customized the Calendar component to enhance functionality and UI
  • Ensured seamless integration with existing features and maintained backward compatibility

…onent

Upgraded react-day-picker from v8.7.1 to v9.6.1 for improved performance and compatibility. Refactored and customized the Calendar component to enhance functionality and UI while ensuring seamless integration with existing features.
Copy link

vercel bot commented Mar 11, 2025

@LeonardoSeptaVN is attempting to deploy a commit to the shadcn-pro Team on Vercel.

A member of the Team first needs to authorize it.

@TeTedo
Copy link

TeTedo commented Mar 12, 2025

I reviewed the code carefully.

It seems that two modifications are needed in both 'calendar.tsx'

Before

<MonthGrid
  children={children}
  className={className}
  displayYears={displayYears}
  startMonth={startMonth}
  endMonth={endMonth}
  navView={navView}
  setNavView={setNavView}
  {...props}
/>

After

<MonthGrid
  className={className}
  displayYears={displayYears}
  startMonth={startMonth}
  endMonth={endMonth}
  navView={navView}
  setNavView={setNavView}
  {...props}
>
  {children}
</MonthGrid>

This change follows the ESLint rule:
"Do not pass children as props. Instead, nest children between the opening and closing tags."

Before

Nav: ({ className }) => (
  <Nav
    className={className}
    displayYears={displayYears}
    navView={navView}
    setDisplayYears={setDisplayYears}
    startMonth={startMonth}
    endMonth={endMonth}
    onPrevClick={onPrevClick}
  />
),

After

Nav: ({ className }) => (
  <Nav
    className={className}
    displayYears={displayYears}
    navView={navView}
    setDisplayYears={setDisplayYears}
    startMonth={startMonth}
    endMonth={endMonth}
    onPrevClick={onPrevClick}
    onNextClick={onNextClick}
  />
),

It looks like onNextClick was mistakenly omitted from the props.

Thank you!

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.

2 participants