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

fix: update calendar.tsx to use PreviousMonthButton and NextMonthButt… #6226

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

Conversation

frankievx
Copy link

@frankievx frankievx commented Dec 30, 2024

…on for react-day-picker

I ran into an type issue with my NextJS build where it seems that IconLeft and IconRight aren't listed in the types for react-day-picker and instead uses PreviousMonthButton and NextMonthButton.

https://daypicker.dev/api/type-aliases/CustomComponents
Screenshot 2024-12-30 at 2 49 47 PM

Copy link

vercel bot commented Dec 30, 2024

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

A member of the Team first needs to authorize it.

@frankievx frankievx closed this Jan 2, 2025
@frankievx frankievx reopened this Jan 2, 2025
@frankievx
Copy link
Author

frankievx commented Jan 2, 2025

@jsdev-robin

here is fixing code `"use client";

import * as React from "react"; import { DayPicker } from "react-day-picker";

import { cn } from "@/lib/utils";

export type CalendarProps = React.ComponentProps;

function Calendar({ className, classNames, showOutsideDays = true, ...props }: CalendarProps) { return ( <DayPicker showOutsideDays={showOutsideDays} className={cn("p-3", className)} classNames={{ months: "flex flex-col sm:flex-row space-y-4 sm:space-y-0", month: "space-y-4", caption_label: "text-sm font-medium block text-center", nav: "space-x-1 flex items-center", button_previous: "absolute top-2 left-2", button_next: "absolute top-2 right-2", chevron: "stroke-1", day: cn( "size-10 font-normal aria-selected:opacity-100 hover:bg-primary/30 hover:text-accent-foreground text-center rounded-full text-sm cursor-pointer" ), today: "text-primary", selected: "bg-primary !rounded-full", range_end: "bg-primary !border-red-500 !rounded-full", range_middle: "bg-primary/30 !rounded-none", range_start: "bg-primary !rounded-full", ...classNames, }} {...props} /> ); } Calendar.displayName = "Calendar";

export { Calendar }; `

I don't know what you changed. It also doesn't even seem to address the issue I raised. Could you make a PR to against this branch that I can review?

@frankievx
Copy link
Author

@jsdev-robin
I see now. The version of React Day Picker I have seems to be a newer version with updated types. If I want to keep them in sync I'll have to update the package in UI and fix all issues that may arise.

@frankievx
Copy link
Author

@jsdev-robin Are you using a chatbot to reply to me?

@frankievx
Copy link
Author

@jsdev-robin Why did you delete your last message?

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.

1 participant