sendou.ink/app/components/elements/Calendar.tsx
Kalle cb8669acc3
New calendar UI, more filters & persisted filters (#2318)
* Add types

* Delete stuff

* wip

* findAllBetweenTwoTimestamps refactor

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Fixes

* wip

* wip

* Fix InfoPopover button styling

* wip

* wip

* wip

* Merge branch 'rewrite' into new-calendar

* wip

* wip

* wip

* wip

* Rename myform -> sendouform

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* rename

* fix test
2025-05-24 17:13:30 +03:00

42 lines
915 B
TypeScript

import clsx from "clsx";
import {
Button,
Calendar,
CalendarCell,
CalendarGrid,
type CalendarProps,
type DateValue,
Heading,
} from "react-aria-components";
import { ArrowLeftIcon } from "~/components/icons/ArrowLeft";
import { ArrowRightIcon } from "~/components/icons/ArrowRight";
export interface SendouCalendarProps<T extends DateValue>
extends CalendarProps<T> {
className?: string;
}
export function SendouCalendar<T extends DateValue>({
className,
...rest
}: SendouCalendarProps<T>) {
return (
<Calendar className={clsx(className, "react-aria-Calendar")} {...rest}>
<header>
<Button slot="previous">
<ArrowLeftIcon />
</Button>
<Heading />
<Button slot="next">
<ArrowRightIcon />
</Button>
</header>
<CalendarGrid>
{(date) => {
return <CalendarCell date={date} data-testid="choose-date-button" />;
}}
</CalendarGrid>
</Calendar>
);
}