mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-24 04:51:13 -05:00
Reverted to commit 10950a4034
This commit is contained in:
@@ -4,20 +4,13 @@ import { DayPicker } from "react-day-picker";
|
||||
|
||||
import { cn } from "@/lib/utils";
|
||||
import { buttonVariants } from "@/components/ui/button";
|
||||
import { CustomCalendarCaption } from "@/components/ui/calendar-custom-caption";
|
||||
|
||||
export type CalendarProps = React.ComponentProps<typeof DayPicker> & {
|
||||
enableYearGrid?: boolean;
|
||||
};
|
||||
export type CalendarProps = React.ComponentProps<typeof DayPicker>;
|
||||
|
||||
function Calendar({ className, classNames, showOutsideDays = true, enableYearGrid = false, ...props }: CalendarProps) {
|
||||
const captionLayout = enableYearGrid ? undefined : (props.captionLayout || "dropdown-buttons");
|
||||
function Calendar({ className, classNames, showOutsideDays = true, ...props }: CalendarProps) {
|
||||
return (
|
||||
<DayPicker
|
||||
showOutsideDays={showOutsideDays}
|
||||
captionLayout={captionLayout}
|
||||
fromYear={props.fromYear || 1800}
|
||||
toYear={props.toYear || new Date().getFullYear() + 10}
|
||||
className={cn("p-3", className)}
|
||||
classNames={{
|
||||
months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
|
||||
@@ -49,15 +42,6 @@ function Calendar({ className, classNames, showOutsideDays = true, enableYearGri
|
||||
...classNames,
|
||||
}}
|
||||
components={{
|
||||
Caption: enableYearGrid
|
||||
? (captionProps) => (
|
||||
<CustomCalendarCaption
|
||||
{...captionProps}
|
||||
fromYear={props.fromYear || 1800}
|
||||
toYear={props.toYear || new Date().getFullYear() + 10}
|
||||
/>
|
||||
)
|
||||
: undefined,
|
||||
IconLeft: ({ ..._props }) => <ChevronLeft className="h-4 w-4" />,
|
||||
IconRight: ({ ..._props }) => <ChevronRight className="h-4 w-4" />,
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user